Neeraja Gandla
1 min readMay 10, 2020

--

Hi Ankur Singh

Good Implementation. In the ‘heapifyDown’ method, I think the less than, greater than signs should be opposite. i.e. the heapifyDown method in the implementation seems to be of MinHeap rather than MaxHeap. Please verify once.

I also have a small suggestion. Instead of using an array, if you use ArrayList the ensureCapacity part will be taken care of by the ArrayList. Not sure if you have intentionally used array to understand what goes behind the scenes

--

--

Neeraja Gandla
Neeraja Gandla

Written by Neeraja Gandla

I’m an Android App Developer by Profession. I would like to write out my thoughts and learning to let others learn through my experiences.

No responses yet