I keep hearing warnings from intelligent people that you shouldn’t trust conclusions drawn from rat studies because they are preliminary and usually sensationalized.
Defining a new class is probably the most Ruby way to do it. There are two implementations that define a new class: rb_heap[1] and algorithms[2]. However, algorithms[2] use a Fibonacci heap, which should technically have better time complexity but is slower in practice, and the library pulls in a lot of unnecessary stuff. rb_heap is good, although I think using a symbol to specify if it's a max/min heap is a little strange.
There is something satisfying about using an array like Python. It's very straightforward and doesn't require you to convert back and forth between a queue and a array.
That's an interesting idea to use Queue. I do need random access to implement the binary queue, so I'm not sure if Queue would work.
I grew up in Oregon, where all the beaches are public. Later I discovered that some people in different places owned beaches, which blew my mind. How can you own a beach?
I then wondered why I felt that way about beaches, but not about other lands.
Really? I can’t imagine people turning off the lazy evaluation. It’s a deep part of the language. You can force things to evaluate strictly, but that’s not disabling it.
Just because of an invention is useful and world changing doesn’t mean it won’t cause a bubble.