Code Understanding - Max Heap to Min Heap

On line 26, why not use smallest instead of index, both will essentially do the same thing. Or am I missing something?

Hi @Ankit_Marothi

My name is Shahrukh Naeem. I hope everything is going well with you. Thank you for reaching out about this. I will try my best to answer your query!

You can use the smallest instead of the index at line 26 because both give the same results and won’t affect the overall output.

I hope that this guide is helpful. Remember that I am always available via message to help you with any difficulty you might encounter.


Happy Learning :slight_smile: