a. Add a node with value 3 to the following min heap. Show the upheap swap process needed to restore the heap-order property. You will need at least three diagrams. Thanks to https://www.cs.cmu.edu/~adamchik/15-121/lectures/Binary%20Heaps/heaps.html You are welcome to use Microsoft Paint (type "mspaint" in the start menu search box) to create several diagrams. Alternatively, use pen and paper, or a whiteboard, and take a picture with your cell phone. 2.b. Remove the root node from the following heap. You will need to downheap swap to restore the heap-order property. Use diagrams to show the state of the heap at each step. You will need at least three diagrams. Thanks to http://www.studytonight.com/data-structures/heap-sort
2.a. Add a node with value 3 to the following min heap. Show the upheap swap process needed to restore the heap-order property. You will need at least three diagrams.
Thanks to https://www.cs.cmu.edu/~adamchik/15-121/lectures/Binary%20Heaps/heaps.html |
You are welcome to use Microsoft Paint (type "mspaint" in the start menu search box) to create several diagrams. Alternatively, use pen and paper, or a whiteboard, and take a picture with your cell phone.
2.b. Remove the root node from the following heap. You will need to downheap swap to restore the heap-order property. Use diagrams to show the state of the heap at each step. You will need at least three diagrams.
Thanks to http://www.studytonight.com/data-structures/heap-sort |
The answer is given below;-
Step by step
Solved in 2 steps with 2 images