Slides - Algorithms

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

Info iconThis preview shows pages 1–5. 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 DocumentRight 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 DocumentRight Arrow Icon
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;
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/28/2010 for the course CSC CSC1110 taught by Professor Cjyuan during the Fall '06 term at CUHK.

Page1 / 10

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

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online