cs lecture sep 30

cs lecture sep 30 - -strike out 1-start at 2-strike out...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Recursion – function calling itself Int gcd (int a , int b) { if(b==9); return a; else gcd(b,a%b); } Sieve of Eratosthenes: a method of finding all the prime numbers up to a specified number n up to 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: -strike out 1-start at 2-strike out multiples of 2 (other than 2)-find next highest number not struck out-strike out that number's multiples -repeat-strike out multiples of 2 (not including 2)...
View Full Document

This note was uploaded on 12/10/2011 for the course CS 137 taught by Professor Clarke during the Fall '10 term at Waterloo.

Ask a homework question - tutors are online