Midterm-2-solution

# Midterm-2-solution - COP-3530 DATA STRUCTURES AND...

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

COP-3530 DATA STRUCTURES AND ALGORITHMS Instructor: Manuel Bermúdez Fall 2010 MIDTERM EXAM 2 Closed Books, Closed Notes, 50 Minutes Problem 1 _______ (15p.) Problem 2 _______ (15p.) Problem 3 _______ (20p.) Problem 4 _______ (25p.) Problem 5 _______ (25p.) SCORE _______ (100p.) UFID : Name : Note: Turn in your work on this exam only

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

View Full Document
Problem 1 (15 pts). Start with an empty Binary Search Tree. (a) Insert the keys 10, 18, 12, 15, 5, 22, 13 into the tree, in the order given. Show the res- ulting Binary Search Tree. (b) Using this tree, which comparisons would be made when searching for the key 12? Which comparisons would be made for 14? (c) Label all nodes with their leftSize values. Use the tree you drew in part (a). (d) Show the various comparisons and rank values as you search for the element with in- dex 4 in this Indexed Binary Search Tree.
Problem 2 (15 pts). Draw the height biased max leftist tree that results when the two height biased max leftist trees below are melded by following their rightmost paths. Use the strategy used in the

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 9

Midterm-2-solution - COP-3530 DATA STRUCTURES AND...

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

View Full Document
Ask a homework question - tutors are online