Efficient queue in Haskell

前端 未结 4 809
攒了一身酷
攒了一身酷 2021-02-01 04:58

How can I efficiently implement a list data structure where I can have 2 views to the head and end of the list, that always point to a head a tail of a list without expensive ca

4条回答
  •  别跟我提以往
    2021-02-01 05:10

    I'm not really a Haskell user, but I found a blog post which claims to describe a Haskell queue that can be operated on in amortized constant time. It's based on a design from Chris Okasaki's excellent Purely Functional Data Structures.

提交回复
热议问题