Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/craig-day/linked_map_set
A LinkedMapSet is an extension to MapSet that maintains ordering.
https://github.com/craig-day/linked_map_set
data-structures elixir linked-list ordered-collections ordered-set
Last synced: 20 days ago
JSON representation
A LinkedMapSet is an extension to MapSet that maintains ordering.
- Host: GitHub
- URL: https://github.com/craig-day/linked_map_set
- Owner: craig-day
- License: mit
- Created: 2021-01-30T18:22:01.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-01-30T20:14:15.000Z (almost 4 years ago)
- Last Synced: 2024-10-19T04:11:05.396Z (3 months ago)
- Topics: data-structures, elixir, linked-list, ordered-collections, ordered-set
- Language: Elixir
- Homepage: https://hexdocs.pm/linked_map_set
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# LinkedMapSet
A `LinkedMapSet` is an extension to [`MapSet`](https://hexdocs.pm/elixir/MapSet.html)
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`](https://hexdocs.pm/elixir/Map.html) underneath, much like
[`MapSet`](https://hexdocs.pm/elixir/MapSet.html), so removing arbitrary items
can happen in logarithmic time, rather than linear time that most sorted
collections incur.## Installation
```elixir
def deps do
[
{:linked_map_set, "~> 0.1.0"}
]
end
```## Usage
See the [documentation](https://hexdocs.pm/linked_map_set) for API reference and examples.