Reputation: 3211
if heaptify this [(10,'Mike'),(20,'Jack'),(10,'Bob')]
And return the min of the heap, will it guaranteed to return (10,'Mike') and not (10,'Bob')
?
Upvotes: 4
Views: 956
Reputation: 46921
no heapq
is not stable. as stated in the examples of the documentation
This is similar to sorted(iterable), but unlike sorted(), this implementation is not stable.
Upvotes: 4