Skip to content

craig-day/linked_map_set

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkedMapSet

A LinkedMapSet is an extension to MapSet that maintains ordering.

It does this by keeping pointers to previous and next elements based on insert order.

I built this to have a collection I can traverse in either direction, but also be able to remove items in less-than-linear time. I also didn't want something that needed to be sorted or rebalanced after each addition or removal.

This uses Map underneath, much like MapSet, so removing arbitrary items can happen in logarithmic time, rather than linear time that most sorted collections incur.

Installation

def deps do
  [
    {:linked_map_set, "~> 0.1.0"}
  ]
end

Usage

See the documentation for API reference and examples.