Homework 2
Any time you provide an algorithm
- Provide the basic timing function, related to the numbered lines in your algorithm.
- Derive a simple version of the timing function.
- State the performance class for your algorithm.
- Argue that your algorithm is correct.
Please do the following problems from the book. Remember your homework needs to be typed.
- [5 points] Problem 10 page 129.
- [3 points] Problem 3, page 181
- [5 points]Problem 11, page 186
- Give the minimum number of breaks.
- Draw a tree for a 5x4 Chocolate bar.
- [10 points] Problem 2, page 205
- [12 points] Problem 6 (a,b,c,e) page 233
- State the worst and average case for each and justify your answers.
- For deletion, assume that item has been found.