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

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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

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

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online