3 ms·
I have used a min-max heap once. I don't remember why I needed it at the time--it was a previous job--but I do remember that I had to roll my own, because it's
by gliese1337 6y ago
I have used a min-max heap once. I don't remember why I needed it at the time--it was a previous job--but I do remember that I had to roll my own, because it's just not that popular of a data structure, and it was the obvious and only good solution to the problem at the time.
So, it's nice to see a detailed analysis of the structure like this! Perhaps if it becomes more popular, I will find more places to use it.
- bjo590 6y agoI used a min heap in a FANG interview. It's an obvious/good solution if the problem has a mix of reading/removing the smallest number in a data structure and writing new numbers to the data structure.
- rgossiaux 6y agoA min heap is different from a min-max heap. A min-max heap supports the operations of both a min heap and a max heap (essentially by interleaving the two). A normal min heap is a standard data structure, a min-max heap less so.
- mav3rick 6y agoIIRC it's used in chess programs to evaluate moves.
- nwallin 6y agoPerhaps you're thinking of minimax? It's an unrelated concept to min-max heaps. https://en.wikipedia.org/wiki/Minimax https://en.wikipedia.org/wiki/Minimax https://en.wikipedia.org/wiki/Min-max_heap https://en.wikipedia.org/wiki/Min-max_heap
- Hello71 6y agoyou're thinking of minimax.
- mav3rick 6y agoAh I was wrong. Yes, you are absolutely correct.