{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Slides - Algorithms

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

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

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

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

View Full Document
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
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)

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

View Full Document
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); . . .
Algorithm Efficiency Algorithms “the systematic study of the fundamental

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

View Full Document

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}