Honestly, though, I don't think such a thing is what this website is aiming at. It seems to be more for the established, widely used stuff.
Still nice, though. (It's cute how, for so many of the "heap" data structures, the merge operation is really all you need to give much thought to. See also Binomial Heap, etc.)
> These 6 lines of code provide a heap data structure with amortized logarithmic time for extractmin and constant time insertion and merging (!).
Hmmm ... maybe. We need to be exceptionally careful in our reasoning about time complexity, when the code uses lazy evaluation (perhaps more careful than people know how to be, yet).
Honestly, though, I don't think such a thing is what this website is aiming at. It seems to be more for the established, widely used stuff.
Still nice, though. (It's cute how, for so many of the "heap" data structures, the merge operation is really all you need to give much thought to. See also Binomial Heap, etc.)
> These 6 lines of code provide a heap data structure with amortized logarithmic time for extractmin and constant time insertion and merging (!).
Hmmm ... maybe. We need to be exceptionally careful in our reasoning about time complexity, when the code uses lazy evaluation (perhaps more careful than people know how to be, yet).