

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Instructions for assignment 8 of the algorithms course, cscd-320, spring 2009. Students are required to draw the corresponding complete binary tree, heapify the tree as a min heap, insert elements using the bubbling up process, and perform remove min operations. Tree and array formats for each step.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Initial state: 12 8 1 4 2 13 10 16 15 5 7 6
Adjusting from 6 down: 12 8 1 4 2 6 10 16 15 5 7 13 Adjusting from 5 down: 12 8 1 4 2 6 10 16 15 5 7 13 Adjusting from 4 down: 12 8 1 4 2 6 10 16 15 5 7 13 Adjusting from 3 down: 12 8 1 4 2 6 10 16 15 5 7 13 Adjusting from 2 down: 12 2 1 4 5 6 10 16 15 8 7 13 Adjusting from 1 down: 1 2 6 4 5 12 10 16 15 8 7 13 [-, 1, 2, 6, 4, 5, 12, 10, 16, 15, 8, 7, 13] Printed 2020/ 11 月/30 at 02:27 Page 1
Inserting 14 1 2 6 4 5 12 10 16 15 8 7 13 14 Inserting 3 1 2 3 4 5 12 6 16 15 8 7 13 14 10 Inserting 11 1 2 3 4 5 12 6 16 15 8 7 13 14 10 11 Inserting 9 1 2 3 4 5 12 6 9 15 8 7 13 14 10 11 16 [-, 1, 2, 3, 4, 5, 12, 6, 9, 15, 8, 7, 13, 14, 10, 11, 16]
Remove min return 1 2 4 3 9 5 12 6 16 15 8 7 13 14 10 11 Remove min return 2 3 4 6 9 5 12 10 16 15 8 7 13 14 11 Remove min return 3 4 5 6 9 7 12 10 16 15 8 11 13 14 [-, 4, 5, 6, 9, 7, 12, 10, 16, 15, 8, 11, 13, 14] Printed 2020/ 11 月/30 at 02: