{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Computer Science 61B - Fall 1997 - Yelick - Midterm 2

# Computer Science 61B - Fall 1997 - Yelick - Midterm 2 -...

This preview shows pages 1–3. Sign up to view the full content.

CS61B Midterm 2 Fall 1997 CS61B Midterm 2 Fall 1997 1) (2 points) Given the following BST, show its value after deleting 95. 2) (2 points) Given a BST, there are some keys that, if inserted will increase the height of the tree. For the BST below, list all the integer keys (distinct from those already in the tree) for which this is true. If no such keys exist, explain why not. (Each key should increase the height if inserted alone, not with other keys.) 3) (4 points) For a given set of keys there are many possible BSTs. Right and left rotations (as defined for Red-Black trees), produce legal BSTs from others. For the BST given below, give another BST with the same keys that CANNOT be formed by performing a sequence of left and right rotations on T. If no such tree exists, explain why not. :34 PM file:///C|/Documents%20and%20Settings/Jason%20Rafte...0-%20Fall%201997%20-%20Yelick%20-%20Midterm%202.htm (1 of 6)1/27/2007 5:40

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS61B Midterm 2 Fall 1997 4) (2 points) Given the following Red-Black tree, show its value after inserting the key 29. (Mark the red nodes with an "R" and black nodes with "B" and show the black nulls at the leaves as in your homework assignment.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern