Convert vector/array to heap

sir why we are getting different output when we are doing
the first method(non optimized method) and when we are doing the second method(heapify method).

hello @YASHMATHURIA123
output should be same from both the approaches.
please mention the video name i will check.


Heaps 12 - Build Heap from Array in O(N) (Code)


Heaps 11 - Build Heap from Array in O(N) (Concept)

ok so see structure of heap may vary for both the approaches.
but at the end u will be getting only sorted output after applying heapsort ( from both the approaches)