cs161: Data Structures and Algorithms Handout #8 Michael Goldwasser Stanford University Tuesday, July 16, 1996

Midterm Examination

Handed Out: Tuesday, 16 July 1996, 3:00pm Due Date: Tuesday, 23 May 1996, 1:15pm

STANFORD UNIVERSITY HONOR CODE

Please sign below, and hand in this cover sheet with your solutions.

I acknowledge and accept the Honor Code.

SIGN YOUR NAME ABOVE THIS LINE

PRINT YOUR NAME ABOVE THIS LINE

POLICY

You can use any book, handout, class notes, etc., but as always you are not allowed to discuss the problems with other people or to get any other outside help. Feel free to contact the TA or the instructor for questions regarding the statement of the problems; however they can not give you any help in solving the problems, except that you are free to ask for clarifications regarding any topic that we covered in the class. You should sign the Honor Code above, and turn it in with your solutions. Please do not view this as a formality, but indeed “uphold the spirit and the letter of the Honor Code.”

Good luck!

Problem 1. (40 points) Do CLR 14-1.

(a) 4 points

(b) 8 points

(c) 4 points

(d) 8 points

(e) 16 points Problem 2. (20 points) Do CLR 14-2-5. Problem 3. (20 points) Do CLR 15.2-1. Problem 4. (20 points) Do CLR 15.3-4.

Extra Credit

Do the “Optional” part of CLR 15.3-4.