Class Notes (837,435)
Canada (510,273)
Computing (443)
CISC 121 (27)
Lecture

9.2.pdf

1 Page
82 Views
Unlock Document

Department
Computing
Course
CISC 121
Professor
Robin W Dawes
Semester
Winter

Description
9.2 Thursday, March 14, 2013 8:32 AM Arithmetic continued… Review: Recursion: Swap pairs - Adding numbers of different size can lose the smaller all together if the gap is large enough. >def swapPairs(list): Python example: if len(list) < 2: >big = 1e30 return list >small =1e40 else: >print big+small return [list[1],list[0]] + swapPairs(list[2:]) 1e30 - Order matters Usual math fact: a+(b+c) =
More Less

Related notes for CISC 121

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit