{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Slides - Algorithms

Slides - Algorithms - Basic Concepts Pseudocode ~ is an...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Basic Concepts Pseudocode ~ is an English-like representation of the algorithm logic. Algorithm addMatrix (matrix1, matrix2, size, matrix3) // Add matrix1 to matrix2 and place results in matrix3 loop (not end of row) loop (not end of column) add matrix1 and matrix2 cells store sum in matrix3 end loop end loop
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Statement Constructs • Sequence • Selection Loop (iteration, recursion) Algorithm deviation // Print deviation from mean for series loop (not end of file) read number into array add number to total increment count end loop
Background image of page 2
set average to total / count print average loop (not end of array) set devFromAve to array element – average print array element and devFromAve end loop Data Structure ~ is an aggregation of atomic and composite data with defined operations. (e.g. Array, record)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Abstract Data Type ADT 9 declaration of data 9 declaration of operations 9 encapsulation of data and operations ADT Implementations ¾ array ¾ linked list (pointers) int i=5, *p; . . . p = &i; printf( “i contains: %d %d \n”, i, *p); . . .
Background image of page 4
Algorithm Efficiency Algorithms “the systematic study of the fundamental
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}