I was just wondering if this was possible?
Surely there maybe some naive methods of doing so, but I was just wondering if someone can suggest efficient ways to do so.
Theoretical Computer Science Stack Exchange is a question and answer site for theoretical computer scientists and researchers in related fields. It only takes a minute to sign up.
Sign up to join this communityI was just wondering if this was possible?
Surely there maybe some naive methods of doing so, but I was just wondering if someone can suggest efficient ways to do so.
You can just ignore that you have a max heap and build your min heap from it. O(n) time complexity. No need for additional array.