I am confused on 2nd part..
Draw the min-heap that results from insertion of the following elements in order into an initially empty min-heap: 7,6,5,4,3,2,17,6,5,4,3,2,1. Show the result after the deletion of the root of this heap.
which case to apply both of them correct and give minheap accordingly.
case 1: Either first create the whole tree by insertion and then apply heapify.
this will result in to minheap whose level order traversal (BFS) is 1 3 2 4 6 7 5.
by removing the root and heapify gives BFS traversal as : 2 3 5 4 6 7
case 2 : apply heapify after every element/node insertion in the tree.
this will result in to minheap whose level order traversal (BFS) is 1 4 2 7 5 6 3.
by removing the root and heapify gives BFS traversal as : 2 4 3 7 5 6.
In above 2nd method is applied.