This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Let m=1210, let n=120, find the GCD Example 4: Let m=125, n=26, find the GCD. Notes about this algorithm It makes use of SEQUENCING (step 1, step 2, step 3) It makes use of SELECTION (if …. . Otherwise …. .) It makes use of REPETITION (return to step 2) What is Programming? Writing programs is called programming We write programs to implement algorithms The three fundamental features of computer programs are: SEQUENCING SELECTION REPETITION The Euclidean algorithm illustrates all three! Another algorithm: Selection Sort Assume we have an unordered list of numbers. Find the minimum value in the list Swap it with the value in the first position Repeat the steps above for the remainder of the list (starting at the second position and advancing each time) Reference: http://en.wikipedia.org/wiki/Selection_sort...
View
Full Document
 Spring '11
 Dr.Ambrose
 Computer Science, Remainder, Euclidean algorithm

Click to edit the document details