Not getting required output


I am getting {20 10 8 9 1 5 6 4} instead of {20 10 9 6 1 5 8 4} when I use code without adding -1 in the beginning

Hey @girishgargcool
Both are max heaps so whats the issue exactly

Since indexes are getting changed so is max heap but both are max heaps

Okay now I get it. Thanks

1 Like