{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw 1 - 5 Sort the following functions in ascending order...

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

CSE 101 Winter 2011—HW1 Due on Thursday, 01/13/2011 Instructions Please read the “Homework policy” in course webpage Answer all five questions from 1 to 5. The bonus question has extra credits. 1. Textbook exercise 3.4 [10] 2. Textbook exercise 3.7 [10] 3. Textbook exercise 3.11 [10] 4. The pigeonhole principle (in its simplest version) states the following: If n+1 balls ( n>=1 ) are [10] put inside n boxes, then at least one box will contain more than one ball. Prove this principle by induction. [Adapted from “Introduction To Algorithms A Creative Approach” by Udi Manber]
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 5. Sort the following functions in ascending order according to big-O complexity – [10] 100n+lgn, (logn) 5 , n/logn, n2 n , 3 n , n!, nlgn, n 1.01 , logn, n 1/2 , n 10 [Bonus] Several gas stations are located along a circular road. The amount of gas in all of the [10] stations together is exactly equal to the amount of gas needed by a car to complete one round. Prove that there exists a station from which a car can start with an empty tank and complete a round....
View Full Document

{[ snackBarMessage ]}