Sunday, 15 September 2013

Complexity of lists in haskell in Data.map

Complexity of lists in haskell in Data.map

Sorry if this seems like an obvious question.
I was creating a Data.map of lists {actually a tuple of an integer and a
list (Integer, [(Integer, Integer)])} for implementing a priority queue +
adjacency list for some graph algorithms like Dijkstras and Prims,
The Data.map is implemented using binary trees(I read that) so I just want
to confirm that when doing the map operations (I believe they will be
rotations) the interpreter does not do deep copies of the list just
shallow copies of the references of lists right?
Thanks in advance.

No comments:

Post a Comment