There are 100 elements. A max-heap was built on them. What is the minimum number of elements that need to be swapped to make a min-heap?
Nodes can be swapped only if they are adjacent (i.e. directly connected to each other) in the heap. In other words, the nodes being swapped must be immediate neighbors in the heap.
Tip: Think about what would happen if the max-heap was already a min-heap. When would a max-heap would also be a min-heap? How many swaps would then be necessary to convert it to a min-heap?