{"_id":"@crimson-carnival/ds-js","_rev":"3-138420dd1f01f01b8a1f8b243fd05a4f","name":"@crimson-carnival/ds-js","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@crimson-carnival/ds-js","version":"1.0.0","keywords":["data-structures","linked-list","stack","queue","deque","typescript"],"author":"","license":"MIT","_id":"@crimson-carnival/ds-js@1.0.0","maintainers":[{"name":"crimson-carnival","email":"agalvis@cotecnova.edu.co"}],"dist":{"shasum":"c1a66fc782b8f0ed3c06d05c962a6b78a0ab84b0","tarball":"https://registry.npmjs.org/@crimson-carnival/ds-js/-/ds-js-1.0.0.tgz","fileCount":27,"integrity":"sha512-NdydZ0Kes63EfaCith38pyrSH0drXcsQrLyHT27YE7RsdWbHowdinI3eCexUSryRfRWuglXsjy7q8DaxYCiF7g==","signatures":[{"sig":"MEQCIGvqKaaUHka0GGdEIr2zzjaQ9h1Hlo8lY3O4Ezswr690AiABoMeXo02EnIQXgkOtmJ/QoOfQ2uRuRbs+KUw7d/1FXw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":211029},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"lint":"eslint .","test":"vitest run","build":"tsup --no-dts && tsc --project tsconfig.build.json","release":"np","test:pq":"vitest run test/priority-queue.test.ts","docs:dev":"cd docs && npm run dev","lint:fix":"eslint . --fix","test:avl":"vitest run test/avl-tree.test.ts","test:dll":"vitest run test/doubly-linked-list.test.ts","test:lru":"vitest run test/lru-cache.test.ts","test:trie":"vitest run test/trie.test.ts","docs:build":"cd docs && npm run build","test:deque":"vitest run test/deque.test.ts","test:graph":"vitest run test/graph.test.ts","test:queue":"vitest run test/queue.test.ts","test:stack":"vitest run test/stack.test.ts","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"crimson-carnival","email":"agalvis@cotecnova.edu.co"},"_npmVersion":"11.6.2","description":"Implementations of common data structures and algorithms","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"np":"^11.2.0","tsup":"^8.5.1","eslint":"^10.2.1","vitest":"^4.1.5","globals":"^17.5.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^25.6.0","typescript-eslint":"^8.59.0"},"_npmOperationalInternal":{"tmp":"tmp/ds-js_1.0.0_1777268437766_0.8500840131200198","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@crimson-carnival/ds-js","version":"1.0.1","keywords":["data-structures","linked-list","stack","queue","deque","typescript"],"author":"","license":"MIT","_id":"@crimson-carnival/ds-js@1.0.1","maintainers":[{"name":"crimson-carnival","email":"agalvis@cotecnova.edu.co"}],"dist":{"shasum":"ae6e4e02c6aa0b3aa0c799156245940459bfabca","tarball":"https://registry.npmjs.org/@crimson-carnival/ds-js/-/ds-js-1.0.1.tgz","fileCount":28,"integrity":"sha512-U0bn77xZdfAkRCnw9RTCH8mfUldePA8s09Fc3SJ8Cjqgqq7wknTOOUQ6rM/0LBinS+KiPUe9yhi551wl85hvXA==","signatures":[{"sig":"MEYCIQD5BxqN2sWeS1v604IibrexgwamCjy2ClD/1wrTyYjZPgIhAIIv8GFcjUgFWjCgNyIcF51osVr47dU7+d/UzrV2Jl0L","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":228537},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"lint":"eslint .","test":"vitest run","build":"tsup --no-dts && tsc --project tsconfig.build.json","release":"np","test:pq":"vitest run test/priority-queue.test.ts","docs:dev":"cd docs && npm run dev","lint:fix":"eslint . --fix","test:avl":"vitest run test/avl-tree.test.ts","test:dll":"vitest run test/doubly-linked-list.test.ts","test:lru":"vitest run test/lru-cache.test.ts","test:trie":"vitest run test/trie.test.ts","docs:build":"cd docs && npm run build","test:deque":"vitest run test/deque.test.ts","test:graph":"vitest run test/graph.test.ts","test:queue":"vitest run test/queue.test.ts","test:stack":"vitest run test/stack.test.ts","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"crimson-carnival","email":"agalvis@cotecnova.edu.co"},"_npmVersion":"11.6.2","description":"Implementations of common data structures and algorithms","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"np":"^11.2.0","tsup":"^8.5.1","eslint":"^10.2.1","vitest":"^4.1.5","globals":"^17.5.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^25.6.0","typescript-eslint":"^8.59.0"},"_npmOperationalInternal":{"tmp":"tmp/ds-js_1.0.1_1777309844328_0.8324507363457336","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@crimson-carnival/ds-js","version":"1.0.2","description":"Implementations of common data structures and algorithms","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"build":"tsup --no-dts && tsc --project tsconfig.build.json","docs:dev":"cd docs && npm run dev","docs:build":"cd docs && npm run build","lint":"eslint .","lint:fix":"eslint . --fix","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:dll":"vitest run test/doubly-linked-list.test.ts","test:stack":"vitest run test/stack.test.ts","test:queue":"vitest run test/queue.test.ts","test:deque":"vitest run test/deque.test.ts","test:lru":"vitest run test/lru-cache.test.ts","test:pq":"vitest run test/priority-queue.test.ts","test:avl":"vitest run test/avl-tree.test.ts","test:graph":"vitest run test/graph.test.ts","test:trie":"vitest run test/trie.test.ts","release":"np"},"keywords":["data-structures","linked-list","stack","queue","deque","typescript"],"author":"","license":"MIT","devDependencies":{"@eslint/js":"^10.0.1","@types/node":"^25.6.0","eslint":"^10.2.1","globals":"^17.5.0","np":"^11.2.0","tsup":"^8.5.1","typescript":"^6.0.3","typescript-eslint":"^8.59.0","vitest":"^4.1.5"},"_id":"@crimson-carnival/ds-js@1.0.2","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-85jSTKlQ1jvt2dI7YsmDrKgBx4lFbiufSCOYUY4WpLUHxYB2w5Bj8wwWXCVHXnp71Nim51+oCSCOAdE2CZA+5Q==","shasum":"0db512705e7d89b06b8ce2ace681657773d009cd","tarball":"https://registry.npmjs.org/@crimson-carnival/ds-js/-/ds-js-1.0.2.tgz","fileCount":28,"unpackedSize":231878,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCnJqo2Nrc/I5LNKW1kNiLYoOK7t5QKLqRCt65/+i4PiAIhAPmw+YhUecFvIbNFHBb46Vutp7gFNjgrXya+x6C4BXGo"}]},"_npmUser":{"name":"crimson-carnival","email":"agalvis@cotecnova.edu.co"},"directories":{},"maintainers":[{"name":"crimson-carnival","email":"agalvis@cotecnova.edu.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ds-js_1.0.2_1777310208760_0.6514708798308548"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-27T05:40:37.630Z","modified":"2026-04-27T17:16:49.055Z","1.0.0":"2026-04-27T05:40:37.915Z","1.0.1":"2026-04-27T17:10:44.472Z","1.0.2":"2026-04-27T17:16:48.925Z"},"license":"MIT","keywords":["data-structures","linked-list","stack","queue","deque","typescript"],"description":"Implementations of common data structures and algorithms","maintainers":[{"name":"crimson-carnival","email":"agalvis@cotecnova.edu.co"}],"readme":"# @crimson-carnival/ds-js\n\nProduction-ready data structures written in TypeScript — zero dependencies, tree-shakeable, fully tested.\n\n[![npm version](https://img.shields.io/npm/v/@crimson-carnival/ds-js)](https://www.npmjs.com/package/@crimson-carnival/ds-js)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)\n[![Tests](https://img.shields.io/badge/tests-178%20passed-brightgreen)](#testing)\n\n## Features\n\n- **9 data structures** — from linked lists to graphs\n- **TypeScript-first** — full generics, `.d.ts` declarations included\n- **Zero dependencies** — no runtime deps, no bloat\n- **Dual format** — ESM and CJS bundles via `tsup`\n- **Tree-shakeable** — import only what you need\n- **178 unit tests** — comprehensive `vitest` coverage\n\n## Install\n\n```bash\nnpm install @crimson-carnival/ds-js\n```\n\n```bash\npnpm add @crimson-carnival/ds-js\n```\n\n```bash\nyarn add @crimson-carnival/ds-js\n```\n\n<details open>\n<summary><strong>TypeScript</strong></summary>\n\n```typescript\nimport { Stack, Queue, Deque, PriorityQueue, Graph, AVLTree, LRUCache } from '@crimson-carnival/ds-js'\n\n// Stack — LIFO\nconst stack = new Stack<number>()\nstack.push(1); stack.push(2)\nstack.pop()   // → 2\n\n// Queue — FIFO\nconst queue = new Queue<string>()\nqueue.enqueue('first'); queue.enqueue('second')\nqueue.dequeue()  // → 'first'\n\n// Deque — double-ended, O(1) at both ends\nconst deque = new Deque<number>()\ndeque.pushFront(1); deque.pushBack(2)\ndeque.popFront()  // → 1\ndeque.popBack()   // → 2\n\n// AVL Tree — self-balancing BST\nconst tree = new AVLTree<number>()\n;[5, 3, 7, 1, 9].forEach(v => tree.insert(v))\ntree.inOrder()  // → [1, 3, 5, 7, 9]\ntree.search(7)  // → true\n\n// PriorityQueue — min-heap; stable FIFO tiebreaking\ninterface Patient { name: string; priority: number }\nconst hospital = new PriorityQueue<Patient>(\n  (a, b) => a.priority - b.priority,\n  { stable: true }     // equal-priority → insertion order\n)\nhospital.enqueue({ name: 'Ana',  priority: 2 })\nhospital.enqueue({ name: 'Luis', priority: 1 })  // critical\nhospital.enqueue({ name: 'Eva',  priority: 2 })\nhospital.dequeue()?.name  // → 'Luis'\nhospital.dequeue()?.name  // → 'Ana'   (FIFO)\nhospital.dequeue()?.name  // → 'Eva'   (FIFO)\n\n// LRU Cache — fixed-capacity O(1) key-value store\nconst cache = new LRUCache<string, number>(3)\ncache.put('a', 1); cache.put('b', 2); cache.put('c', 3)\ncache.put('d', 4)  // evicts 'a' (least recently used)\ncache.get('a')     // → undefined\ncache.get('b')     // → 2\n\n// Graph — adjacency-list, directed or undirected\nconst g = new Graph<string>(false)  // undirected\ng.addEdge('A', 'B'); g.addEdge('A', 'C'); g.addEdge('B', 'D')\ng.bfs('A')  // → ['A', 'B', 'C', 'D']\ng.dfs('A')  // → ['A', 'B', 'D', 'C']\n```\n\n</details>\n\n<details>\n<summary><strong>JavaScript</strong></summary>\n\n```javascript\nimport { Stack, Queue, Deque, PriorityQueue, Graph, AVLTree, LRUCache } from '@crimson-carnival/ds-js'\n\n// Stack — LIFO\nconst stack = new Stack()\nstack.push(1); stack.push(2)\nstack.pop()   // → 2\n\n// Queue — FIFO\nconst queue = new Queue()\nqueue.enqueue('first'); queue.enqueue('second')\nqueue.dequeue()  // → 'first'\n\n// Deque — double-ended, O(1) at both ends\nconst deque = new Deque()\ndeque.pushFront(1); deque.pushBack(2)\ndeque.popFront()  // → 1\ndeque.popBack()   // → 2\n\n// AVL Tree — self-balancing BST\nconst tree = new AVLTree()\n;[5, 3, 7, 1, 9].forEach(v => tree.insert(v))\ntree.inOrder()  // → [1, 3, 5, 7, 9]\ntree.search(7)  // → true\n\n// PriorityQueue — min-heap; stable FIFO tiebreaking\nconst hospital = new PriorityQueue(\n  (a, b) => a.priority - b.priority,\n  { stable: true }     // equal-priority → insertion order\n)\nhospital.enqueue({ name: 'Ana',  priority: 2 })\nhospital.enqueue({ name: 'Luis', priority: 1 })  // critical\nhospital.enqueue({ name: 'Eva',  priority: 2 })\nhospital.dequeue().name  // → 'Luis'\nhospital.dequeue().name  // → 'Ana'   (FIFO)\nhospital.dequeue().name  // → 'Eva'   (FIFO)\n\n// LRU Cache — fixed-capacity O(1) key-value store\nconst cache = new LRUCache(3)\ncache.put('a', 1); cache.put('b', 2); cache.put('c', 3)\ncache.put('d', 4)  // evicts 'a' (least recently used)\ncache.get('a')     // → undefined\ncache.get('b')     // → 2\n\n// Graph — adjacency-list, directed or undirected\nconst g = new Graph(false)  // undirected\ng.addEdge('A', 'B'); g.addEdge('A', 'C'); g.addEdge('B', 'D')\ng.bfs('A')  // → ['A', 'B', 'C', 'D']\ng.dfs('A')  // → ['A', 'B', 'D', 'C']\n```\n\n</details>\n\n---\n\n## API Reference\n\n### DoublyLinkedList\\<T\\>\n\nA doubly linked list with O(1) insertion and removal at both ends. Foundation for Stack, Queue, Deque, and LRU Cache.\n\n```typescript\nimport { DoublyLinkedList } from '@crimson-carnival/ds-js'\n```\n\n| Method | Returns | Complexity |\n|--------|---------|------------|\n| `push(value)` | `this` | O(1) |\n| `pop()` | `T \\| undefined` | O(1) |\n| `unshift(value)` | `this` | O(1) |\n| `shift()` | `T \\| undefined` | O(1) |\n| `get(index)` | `Node<T>` | O(n) |\n| `set(index, value)` | `void` | O(n) |\n| `insert(index, value)` | `void` | O(n) |\n| `remove(index)` | `T` | O(n) |\n| `removeNode(node)` | `T` | O(1) |\n| `findNode(predicate)` | `Node<T> \\| undefined` | O(n) |\n| `find(predicate)` | `T \\| undefined` | O(n) |\n| `indexOf(value)` | `number` | O(n) |\n| `contains(value)` | `boolean` | O(n) |\n| `toArray()` | `T[]` | O(n) |\n| `clear()` | `void` | O(1) |\n| `isEmpty()` | `boolean` | O(1) |\n| `size` | `number` | O(1) |\n| `[Symbol.iterator]()` | `Iterator<T>` | O(n) |\n\n---\n\n### Stack\\<T\\>\n\nLIFO stack backed by DoublyLinkedList.\n\n```typescript\nimport { Stack } from '@crimson-carnival/ds-js'\n```\n\n| Method | Returns | Complexity |\n|--------|---------|------------|\n| `push(value)` | `void` | O(1) |\n| `pop()` | `T \\| undefined` | O(1) |\n| `peek()` | `T \\| undefined` | O(1) |\n| `toArray()` | `T[]` | O(n) |\n| `clear()` | `void` | O(1) |\n| `isEmpty()` | `boolean` | O(1) |\n| `size` | `number` | O(1) |\n\n---\n\n### Queue\\<T\\>\n\nFIFO queue backed by DoublyLinkedList with task cancellation support.\n\n```typescript\nimport { Queue } from '@crimson-carnival/ds-js'\n```\n\n| Method | Returns | Complexity |\n|--------|---------|------------|\n| `enqueue(value)` | `void` | O(1) |\n| `dequeue()` | `T \\| undefined` | O(1) |\n| `peek()` | `T \\| undefined` | O(1) |\n| `cancel(predicate)` | `boolean` | O(n) |\n| `positionOf(predicate)` | `number \\| undefined` | O(n) |\n| `toArray()` | `T[]` | O(n) |\n| `clear()` | `void` | O(1) |\n| `isEmpty()` | `boolean` | O(1) |\n| `size` | `number` | O(1) |\n\n---\n\n### Deque\\<T\\>\n\nDouble-ended queue — insert and remove from both ends in O(1).\n\n```typescript\nimport { Deque } from '@crimson-carnival/ds-js'\n```\n\n| Method | Returns | Complexity |\n|--------|---------|------------|\n| `pushBack(value)` | `void` | O(1) |\n| `pushFront(value)` | `void` | O(1) |\n| `popBack()` | `T \\| undefined` | O(1) |\n| `popFront()` | `T \\| undefined` | O(1) |\n| `peekBack()` | `T \\| undefined` | O(1) |\n| `peekFront()` | `T \\| undefined` | O(1) |\n| `toArray()` | `T[]` | O(n) |\n| `clear()` | `void` | O(1) |\n| `isEmpty()` | `boolean` | O(1) |\n| `size` | `number` | O(1) |\n| `[Symbol.iterator]()` | `Iterator<T>` | O(n) |\n\n---\n\n### LRUCache\\<K, V\\>\n\nLeast Recently Used cache with fixed capacity. Combines a DoublyLinkedList (access order) with a Map (O(1) key lookup). When full, the least recently used entry is evicted automatically.\n\n```typescript\nimport { LRUCache } from '@crimson-carnival/ds-js'\n```\n\n| Method | Returns | Complexity |\n|--------|---------|------------|\n| `get(key)` | `V \\| undefined` | O(1) |\n| `put(key, value)` | `void` | O(1) |\n| `has(key)` | `boolean` | O(1) |\n| `delete(key)` | `boolean` | O(1) |\n| `entries()` | `[K, V][]` | O(n) |\n| `clear()` | `void` | O(1) |\n| `isEmpty()` | `boolean` | O(1) |\n| `size` | `number` | O(1) |\n| `capacity` | `number` | O(1) |\n\n---\n\n### PriorityQueue\\<T\\>\n\nMin-heap based priority queue. The element with the highest priority (smallest value by default) is always dequeued first.\n\nSupports an optional **`stable`** mode that guarantees FIFO ordering among elements with equal priority — ideal for scheduling, hospital triage, and task queues.\n\n```typescript\nimport { PriorityQueue } from '@crimson-carnival/ds-js'\n\n// Default min-heap\nconst pq = new PriorityQueue<number>()\npq.enqueue(5); pq.enqueue(1); pq.enqueue(3)\npq.dequeue()  // → 1\n\n// Custom comparator (max-heap)\nconst maxHeap = new PriorityQueue<number>((a, b) => b - a)\n\n// Stable mode — FIFO tiebreaking when priorities are equal\ninterface Task { label: string; priority: number }\nconst queue = new PriorityQueue<Task>(\n  (a, b) => a.priority - b.priority,\n  { stable: true }\n)\n```\n\n| Method / Getter | Returns | Complexity |\n|----------------|---------|------------|\n| `enqueue(value)` | `void` | O(log n) |\n| `dequeue()` | `T \\| undefined` | O(log n) |\n| `peek()` | `T \\| undefined` | O(1) |\n| `toArray()` | `T[]` | O(n) |\n| `clear()` | `void` | O(1) |\n| `isEmpty()` | `boolean` | O(1) |\n| `size` | `number` | O(1) |\n| `stable` | `boolean` | O(1) |\n\n---\n\n### AVLTree\\<T\\>\n\nSelf-balancing binary search tree. Guarantees O(log n) insert, search, and delete by maintaining height balance (|left.height − right.height| ≤ 1) via rotations.\n\n```typescript\nimport { AVLTree } from '@crimson-carnival/ds-js'\n\n// Custom comparator\nconst tree = new AVLTree<{ id: number }>((a, b) => a.id - b.id)\n```\n\n| Method | Returns | Complexity |\n|--------|---------|------------|\n| `insert(value)` | `void` | O(log n) |\n| `search(value)` | `boolean` | O(log n) |\n| `delete(value)` | `boolean` | O(log n) |\n| `min()` | `T \\| undefined` | O(log n) |\n| `max()` | `T \\| undefined` | O(log n) |\n| `inOrder()` | `T[]` | O(n) |\n| `preOrder()` | `T[]` | O(n) |\n| `postOrder()` | `T[]` | O(n) |\n| `clear()` | `void` | O(1) |\n| `isEmpty()` | `boolean` | O(1) |\n| `size` | `number` | O(1) |\n\n---\n\n### Trie\n\nPrefix tree optimized for string operations — autocomplete, spell-checking, prefix search.\n\n```typescript\nimport { Trie } from '@crimson-carnival/ds-js'\n```\n\n| Method | Returns | Complexity |\n|--------|---------|------------|\n| `insert(word)` | `void` | O(L) |\n| `search(word)` | `boolean` | O(L) |\n| `startsWith(prefix)` | `boolean` | O(L) |\n| `delete(word)` | `boolean` | O(L) |\n| `wordsWithPrefix(prefix)` | `string[]` | O(L + k) |\n| `clear()` | `void` | O(1) |\n| `isEmpty()` | `boolean` | O(1) |\n| `size` | `number` | O(1) |\n\n> **L** = word/prefix length, **k** = total characters in matching results\n\n---\n\n### Graph\\<T\\>\n\nWeighted adjacency-list graph with BFS and DFS traversals. Supports both directed and undirected modes.\n\n```typescript\nimport { Graph } from '@crimson-carnival/ds-js'\n\nconst graph = new Graph<string>(false)  // undirected\ngraph.addEdge('A', 'B', 5)\ngraph.addEdge('B', 'C', 3)\ngraph.bfs('A')  // → ['A', 'B', 'C']\n```\n\n| Method | Returns | Complexity |\n|--------|---------|------------|\n| `addVertex(v)` | `void` | O(1) |\n| `removeVertex(v)` | `boolean` | O(V + E) |\n| `addEdge(u, v, weight?)` | `void` | O(1) |\n| `removeEdge(u, v)` | `boolean` | O(1) |\n| `hasVertex(v)` | `boolean` | O(1) |\n| `hasEdge(u, v)` | `boolean` | O(1) |\n| `neighbors(v)` | `T[]` | O(deg v) |\n| `weight(u, v)` | `number \\| undefined` | O(1) |\n| `bfs(start)` | `T[]` | O(V + E) |\n| `dfs(start)` | `T[]` | O(V + E) |\n| `clear()` | `void` | O(1) |\n| `isEmpty()` | `boolean` | O(1) |\n| `vertexCount` | `number` | O(1) |\n| `edgeCount` | `number` | O(1) |\n| `directed` | `boolean` | O(1) |\n\n---\n\n## Complexity Overview\n\n| Structure | Insert | Delete | Search/Access | Space |\n|-----------|--------|--------|---------------|-------|\n| DoublyLinkedList | O(1)* | O(1)* | O(n) | O(n) |\n| Stack | O(1) | O(1) | O(n) | O(n) |\n| Queue | O(1) | O(1) | O(n) | O(n) |\n| Deque | O(1) | O(1) | O(n) | O(n) |\n| LRU Cache | O(1) | O(1) | O(1) | O(n) |\n| Priority Queue | O(log n) | O(log n) | O(1)† | O(n) |\n| AVL Tree | O(log n) | O(log n) | O(log n) | O(n) |\n| Trie | O(L) | O(L) | O(L) | O(Σ L) |\n| Graph | O(1) | O(V+E) | O(1) | O(V+E) |\n\n\\* At head/tail. By index is O(n).  \n† Peek only. Arbitrary access is O(n).\n\n## Testing\n\n```bash\nnpm test             # run all 178 tests\nnpm run test:watch   # watch mode\nnpm run test:lru     # run a single suite\n```\n\n## Building\n\n```bash\nnpm run build        # ESM + CJS + .d.ts\n```\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md"}