Why no immutable double linked list in Scala collections?

后端 未结 5 640
轻奢々
轻奢々 2021-02-05 16:33

Looking at this question, where the questioner is interested in the first and last instances of some element in a List, it seems a more efficient solution would be

5条回答
  •  长发绾君心
    2021-02-05 17:36

    As a supplemental to the answer of @KimStebel I like to add:
    If you are searching for a data structure suitable for the question that motivated you to ask this question, then you might have a look at Extreme Cleverness: Functional Data Structures in Scala by @DanielSpiewak.

提交回复
热议问题