Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/craig-day/linked_map
https://github.com/craig-day/linked_map
data-structures elixir ordered-collections ordered-map
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/craig-day/linked_map
- Owner: craig-day
- License: mit
- Created: 2021-01-29T19:41:32.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-01T22:18:34.000Z (almost 4 years ago)
- Last Synced: 2024-10-19T04:11:03.951Z (3 months ago)
- Topics: data-structures, elixir, ordered-collections, ordered-map
- Language: Elixir
- Homepage: https://hexdocs.pm/linked_map
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# LinkedMap
A LinkedMap is a order-aware collection with the following properties:
- A `head` pointer
- A `tail` pointer
- A collection of `items` that can be added to, removed from, and traversed
in either directionI 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 Elixir's [`Map`](https://hexdocs.pm/elixir/Map.html) underneath, so
removing arbitrary items can happen in logarithmic time, rather than linear
time that most sorted collections incur.## Installation
Add `linked_map` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:linked_map, "~> 0.2.0"}
]
end
```## Usage
See the [documentation](https://hexdocs.pm/linked_map) for API reference and examples.