Midterm-2-solution

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

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

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

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

View Full DocumentRight Arrow Icon
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.
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online