mst-dheapsex - Engineering Exercises 1. The figure below...

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

View Full Document Right Arrow Icon
Engineering xercises Exercises 1. The figure below shows a 3-heap. 2. Construct an example of a 2-heap on 15 items for which a deletemin operation requires the largest amount of time possible. Construct an example of a 2-heap on 15 items for which a sequence of 15 deletemin operations requires the maximum amount of time possible. The 2-heap shown below satisfies both parts of the question. b e f g a d h 7 8 10 5 4 6 2 c 3 8 10 4 5 6 3 2 7 fghijklm abcde key 8 2 4 1 pos 6 7 3 5 d b h c h f g a e 6 7 8 9 10 11 12 13 12345 1 Show the heap contents after the inserting new items i , j , k , l and m with keys 3, 6 ,1 , 2, 9. Show the heap state both in picture form and in array form, as above. k 1 67891 0 1 1 1 2 1 3 c 2 b 5 a elete items nd nd show the contents after these operations b e f g a h j i 7 8 10 5 4 6 3 6 c l m d 329 2 8 10 4 3 6 1 2 9 5 6 3 2 7 key 8 2 11 4 pos 6 7 9 3 10 1 12 13 5 k b i d h f g a h j c l m e i 11 j 12 k 7 f 4 h 14 l 13 e 6 d 8 m 9 n 10 o 15 g 3 Delete items d and k and show the contents after these operations.
Background image of page 1

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

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

This note was uploaded on 03/03/2010 for the course CSE 541 taught by Professor Buhler during the Spring '09 term at Washington University in St. Louis.

Page1 / 2

mst-dheapsex - Engineering Exercises 1. The figure below...

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

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