{"id":18023509,"url":"https://github.com/jasonheecs/js-data-structures","last_synced_at":"2025-03-27T00:30:37.831Z","repository":{"id":44174877,"uuid":"130241371","full_name":"jasonheecs/js-data-structures","owner":"jasonheecs","description":"An npm package containing implementations of various data structures in Javascript.","archived":false,"fork":false,"pushed_at":"2022-12-07T17:59:19.000Z","size":334,"stargazers_count":3,"open_issues_count":12,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T03:48:57.590Z","etag":null,"topics":["binary-search-tree","circular-linked-list","computer-science","data-structures","doubly-linked-list","javascript","linked-list","min-heap","npm-package","queue","stack","trie"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@jasonheecs/js-data-structures","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jasonheecs.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}},"created_at":"2018-04-19T16:09:02.000Z","updated_at":"2021-06-16T02:24:51.000Z","dependencies_parsed_at":"2023-01-24T20:15:11.982Z","dependency_job_id":null,"html_url":"https://github.com/jasonheecs/js-data-structures","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonheecs%2Fjs-data-structures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonheecs%2Fjs-data-structures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonheecs%2Fjs-data-structures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonheecs%2Fjs-data-structures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasonheecs","download_url":"https://codeload.github.com/jasonheecs/js-data-structures/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245760536,"owners_count":20667886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["binary-search-tree","circular-linked-list","computer-science","data-structures","doubly-linked-list","javascript","linked-list","min-heap","npm-package","queue","stack","trie"],"created_at":"2024-10-30T07:09:46.981Z","updated_at":"2025-03-27T00:30:37.054Z","avatar_url":"https://github.com/jasonheecs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Structures in Javascript\n[![Build Status](https://travis-ci.org/jasonheecs/js-data-structures.svg?branch=master)](https://travis-ci.org/jasonheecs/js-data-structures) [![Coverage Status](https://coveralls.io/repos/github/jasonheecs/js-data-structures/badge.svg?branch=master)](https://coveralls.io/github/jasonheecs/js-data-structures?branch=master)\n\nA package containing implementations of various data structures in Javascript. This project is mainly a learning exercise and personal refresher on the common CS data structures, in addition to playing around with test coverage reports with [coveralls](https://coveralls.io/)\n\n## Installation\n`npm install @jasonheecs/js-data-structures --save`\n\n## Data Structures\n- [Binary Search Tree](src/binary-search-tree.js)\n- [Singly Linked List](src/singly-linked-list.js)\n- [Doubly Linked List](src/doubly-linked-list.js)\n- [Circular Linked List](src/circular-linked-list.js)\n- [Queue](src/queue.js)\n- [Stack](src/stack.js)\n- [Trie](src/trie.js)\n- [Min Heap](src/min-heap.js)\n- [Graph](src/graph.js)\n\n## Usage\n```js\n    var {BST} = require('@jasonheecs/js-data-structures');\n    var {List} = require('@jasonheecs/js-data-structures');\n    var {Trie} = require('@jasonheecs/js-data-structures');\n\n    var bst = new BST();\n    bst.add(10);\n    bst.add(5);\n    bst.add(15);\n\n    console.log(bst.inOrder()); // [5, 10, 15]\n\n\n    var linkedList = new List();\n    linkedList.add(1);\n    linkedList.add(2);\n    linkedList.add(3);\n\n    console.log(linkedList.search(2)); // Node { value: 2, next: Node { value: 3, next: null } }\n\n\n    var trie = new Trie();\n    trie.addWord('cat');\n    trie.addWord('car');\n    trie.addWord('dog');\n\n    console.log(trie.find('ca')); \n    /** Node { value: 'a', children: Map {\n         't' =\u003e Node { value: 't', children: Map {}, isCompleteWord: true },\n         'r' =\u003e Node { value: 'r', children: Map {}, isCompleteWord: true } },\n        isCompleteWord: false } **/\n```\n\n## Running unit tests\n`npm test`\n\nTo run a specific test file, you can use an extra `--` to pass the filename through:  \n`npm test -- test/binary-search-tree-test.js`\n\n## License\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonheecs%2Fjs-data-structures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasonheecs%2Fjs-data-structures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonheecs%2Fjs-data-structures/lists"}