Efficient heaps in purely functional languages

后端 未结 9 1901
被撕碎了的回忆
被撕碎了的回忆 2021-01-30 13:42

As an exercise in Haskell, I\'m trying to implement heapsort. The heap is usually implemented as an array in imperative languages, but this would be hugely inefficient in purely

9条回答
  •  臣服心动
    2021-01-30 13:52

    Just like in efficient Quicksort algorithms written in Haskell, you need to use monads (state transformers) to do stuff in-place.

提交回复
热议问题