In the first if statement in insert()
1 Like
We are inserting -num to build a max heap. The default implementation is for the min-heap, to make it max-heap we make each number negative.
3 Likes
Thanks!