if i am getting it right then i guess because heap is not stable i.e it
does not guarantee that if there is multiple same elements say 4,4,4,5,5,10

then doing extract min and extract max would may not give oldest index or
you can say that 1st occurance  of those multiple same elements i.e

arr[]=  4,4,4,5,5,5,
index=1,2,3,4,5,6

now doing extract min it may return 4 at index 3 instead of 4 at index 1.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to