ECE165_2010SPRING_EXAM1__[0]

ECE165_2010SPRING_EXAM1__[0] - Data Structures and...

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: Data Structures and Algorithms II Summer 2010 Take-home Test Name: __________________________________________________________________ E-mail: _________________________________________________________________ This is an open-book, open-notes test. You may also search for related topics and read more about them, but you may not ask anyone questions (or post questions to a forum) while taking the test. You will have approximately 24 hours to take the test. The time that the test is due will be specified in the e-mail that includes the test as an attachment. You must e-mail the completed test to me at [email protected] You may print out the test, do it on paper, scan it, and send it; or, do it electronically (but that might be difficult for some questions). You may use scrap paper, of course, but do not scan or send that to me. (1) Answer the following questions about binary heaps: (a) Show the result of inserting the values 80, 26, 40, 37, 96, 17, 32, 99, 21, one at a time, into an initially empty binary heap. (Assume that the binary heap supports the deleteMin operation, not the deleteMax operation.) Draw the resulting tree ; you do not have to draw the trees that result along the way. (b) Show the result of using the guaranteed linear-time algorithm discussed in the textbook (buildHeap) to build a binary heap using the same input. Assume that you start by inserting the data into the array representation of the heap in the order specified in part (a). (c) Show the resulting trees after each of three deleteMin operations is applied to each of the binary heap from part (a). In other words, starting with the resulting heap from part (a), show the result after 1 deleteMin operation, after 2 deleteMin operations, and after 3 deleteMin operations. (2) Consider the following leftist heaps: Leftist heap A: Leftist heap B: (a) Label each node in both of the given leftist heaps with its null path length. Use the conventions discussed in our text book. You may write the null path length next to each node in the figures on the previous page....
View Full Document

{[ snackBarMessage ]}

Page1 / 13

ECE165_2010SPRING_EXAM1__[0] - Data Structures and...

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

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