This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: c) Show the sequence of list values examined by binary search as it unsuccessfully searches for 100 in this list. (4 points) 78 85 86 99 1 point for each number d) Show the sequence of list values examined by binary search as it successfully searches for 1 in this list. (4 points) 78 15 1 1 point for each number plus a bonus (for any answer) 2. Consider algorithm performance. a) Suppose that you have two different algorithms to solve the same problem. The first of these algorithms is known to be O(n 2 ), the second O(n log n) for an input of size n. Which of these algorithms would you use? (2 points) O (n log n) 2 points b) What will be the approximate performance of the algorithms in part a if they are applied to 10,000 items? (2 points) O(n 2 ) = 10,000 * 10,000 = 100,000,000 1 point O(n log n) = 14 * 10.000 = 140,000 1 point...
View Full Document
This note was uploaded on 04/10/2008 for the course CSCI 1100 taught by Professor Hardwick during the Spring '08 term at Rensselaer Polytechnic Institute.
- Spring '08
- Computer Science