hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

Doubly linked list question.

Last post 05-20-2008, 18:23 by jdh30. 1 replies.
Sort Posts: Previous Next
  •  05-20-2008, 16:45 5977

    Doubly linked list question.

    I'm walking through a computational geometry book, implementing each data structure in F# and the example that I was working on is a range tree.  The book depicts the bottom rung of the tree as essentially a doubly linked list.  Mid-way through my insert function I realized that I could not think of a way to implement a doubly linked list without using mutable values in my nodes.  Is this correct?  I think I'm right, and some quick searching of haskell and ocaml code seems to confirm this, I just wanted to make sure.
  •  05-20-2008, 18:23 5979 in reply to 5977

    Re: Doubly linked list question.

    You are correct: doubly linked lists are almost always mutable data structures. However, you might consider trying to create an immutable range tree implementation instead. Perhaps you could use the original mutable one for testing.
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems