{"id":15010141,"url":"https://github.com/elliotekj/doubly_linked_list","last_synced_at":"2026-03-17T07:38:30.847Z","repository":{"id":205799819,"uuid":"715254573","full_name":"elliotekj/doubly_linked_list","owner":"elliotekj","description":"A fast, amortised O(log n) doubly linked list implementation","archived":false,"fork":false,"pushed_at":"2023-11-07T10:27:32.000Z","size":53,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-29T00:26:41.762Z","etag":null,"topics":["data-structures","doubly-linked-list","elixir"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elliotekj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-06T19:19:24.000Z","updated_at":"2023-12-01T10:21:02.000Z","dependencies_parsed_at":"2023-11-10T11:34:32.425Z","dependency_job_id":null,"html_url":"https://github.com/elliotekj/doubly_linked_list","commit_stats":null,"previous_names":["elliotekj/doubly_linked_list"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elliotekj/doubly_linked_list","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotekj%2Fdoubly_linked_list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotekj%2Fdoubly_linked_list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotekj%2Fdoubly_linked_list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotekj%2Fdoubly_linked_list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliotekj","download_url":"https://codeload.github.com/elliotekj/doubly_linked_list/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotekj%2Fdoubly_linked_list/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30617516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T04:46:40.957Z","status":"ssl_error","status_checked_at":"2026-03-17T04:46:32.538Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-structures","doubly-linked-list","elixir"],"created_at":"2024-09-24T19:30:45.140Z","updated_at":"2026-03-17T07:38:30.815Z","avatar_url":"https://github.com/elliotekj.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Doubly Linked List\n\n**A fast, amortised O(log n) doubly linked list implementation.**\n\nA doubly linked list is a type of linked list in which each node contains three\nelements: a data value, a pointer to the next node in the list, and a pointer to\nthe previous node. This two-way linkage allows traversal of the list in both\ndirections, forward and backward, which is a significant advantage over a singly\nlinked list that can only be traversed in one direction.\n\n## Installation\n\nThe package can be installed by adding `doubly_linked_list` to your list of\ndependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:doubly_linked_list, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Usage ([full documentation](https://hexdocs.pm/doubly_linked_list))\n\nA new doubly linked list can be constructed using `new/0`:\n\n```elixir\niex\u003e dll = DoublyLinkedList.new()\n#DoublyLinkedList\u003c[]\u003e\n```\n\nMany types of insertion and deletion are supported, the most basic being\n`insert_head/2`, `insert_tail/2`, `remove_head/1` and `remove_tail/2` which will\ninsert and remove at the head and tail of the doubly linked list respectively:\n\n```elixir\niex\u003e dll = DoublyLinkedList.new()\n#DoublyLinkedList\u003c[]\u003e\n\niex\u003e {dll, node} = DoublyLinkedList.insert_tail(dll, \"tail value\")\n{#DoublyLinkedList\u003c[\"tail value\"]\u003e, #DoublyLinkedNode\u003c\"tail value\"\u003e}\n\niex\u003e {dll, node} = DoublyLinkedList.insert_head(dll, \"head value\")\n{#DoublyLinkedList\u003c[\"head value\", \"tail value\"]\u003e, #DoublyLinkedNode\u003c\"head value\"\u003e}\n\niex\u003e dll = DoublyLinkedList.remove_tail(dll)\n#DoublyLinkedList\u003c[\"head value\"]\u003e\n\niex\u003e dll = DoublyLinkedList.remove_head(dll)\n#DoublyLinkedList\u003c[]\u003e\n```\n\nNode data can be updated with `update/3`:\n\n```elixir\niex\u003e dll = DoublyLinkedList.new()\n#DoublyLinkedList\u003c[]\u003e\n\niex\u003e {dll, node} = DoublyLinkedList.insert_tail(dll, \"tail value\")\n{#DoublyLinkedList\u003c[\"tail value\"]\u003e, #DoublyLinkedNode\u003c\"tail value\"\u003e}\n\niex\u003e dll = DoublyLinkedList.update(dll, node, \"new tail value\")\n#DoublyLinkedList\u003c[\"new tail value\"]\u003e\n```\n\nThere are two options for traversal. `DoublyLinkedList` implements the\nEnumerable protocol so `Enum.map/2`, `Enum.member?/2`,\n[etc](https://hexdocs.pm/elixir/1.12/Enum.html#functions) are supported; there\nare also the built-in `find_from_head/2` and `find_from_tail/2` functions.\n`find_from_tail/2` is of particular interest as it traverses the list in\nreverse. Note that traversal methods are O(n).\n\n```elixir\niex\u003e dll = DoublyLinkedList.new()\niex\u003e {dll, node} = DoublyLinkedList.insert_tail(dll, 1)\niex\u003e {dll, node} = DoublyLinkedList.insert_tail(dll, 2)\n{#DoublyLinkedList\u003c[1, 2]\u003e, #DoublyLinkedNode\u003c2\u003e}\n\niex\u003e Enum.map(dll, fn v -\u003e v * 2 end)\n[2, 4]\n```\n\n## License\n\n`DoublyLinkedList` is released under the [`Apache License\n2.0`](https://github.com/elliotekj/doubly_linked_list/blob/main/LICENSE).\n\n## About\n\nThis package was written by [Elliot Jackson](https://elliotekj.com).\n\n- Blog: [https://elliotekj.com](https://elliotekj.com)\n- Email: elliot@elliotekj.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotekj%2Fdoubly_linked_list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliotekj%2Fdoubly_linked_list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotekj%2Fdoubly_linked_list/lists"}