|
|
|
|
|
by SeveredCross
5622 days ago
|
|
I found the two-queue technique to be much more intuitive than the binary heap technique, which definitely resulted in it being more fun to code. As an aside, the two-queue technique is also more performant, as you can build the tree in O (n) time instead of O (n log n) time. |
|
If you squint just about right, you can probably see the equivalence between sorting plus queues and the tree based techniques. Especially if you use a tree-structured sorting algorithm.