{"id":13432333,"url":"https://github.com/duereg/js-algorithms","last_synced_at":"2025-05-15T16:07:47.036Z","repository":{"id":4318204,"uuid":"5452161","full_name":"duereg/js-algorithms","owner":"duereg","description":"Javascript versions of classic software development algorithms","archived":false,"fork":false,"pushed_at":"2023-08-26T18:43:17.000Z","size":377,"stargazers_count":928,"open_issues_count":1,"forks_count":236,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-03-31T23:36:45.278Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"blog.mattblair.co","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duereg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2012-08-17T12:49:53.000Z","updated_at":"2025-03-12T22:30:50.000Z","dependencies_parsed_at":"2024-01-07T11:08:11.826Z","dependency_job_id":"d78aa6cc-6fb8-416b-82db-e44dc8307a95","html_url":"https://github.com/duereg/js-algorithms","commit_stats":{"total_commits":200,"total_committers":13,"mean_commits":"15.384615384615385","dds":0.52,"last_synced_commit":"bf9e8309c36519640ef905df45b00503a83f517d"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duereg%2Fjs-algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duereg%2Fjs-algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duereg%2Fjs-algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duereg%2Fjs-algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duereg","download_url":"https://codeload.github.com/duereg/js-algorithms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755560,"owners_count":20990620,"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":[],"created_at":"2024-07-31T02:01:10.431Z","updated_at":"2025-04-08T00:39:08.462Z","avatar_url":"https://github.com/duereg.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Github Libraries"],"sub_categories":[],"readme":"[![NPM version](https://badge.fury.io/js/js-algorithms.svg)](http://badge.fury.io/js/js-algorithms)\n\nJS-Algorithms\n=============\n\nIn case you want to prepare yourself for a job interview, or just need access to common data structures.\n\nI've documented the process of creating this code [here](http://blog.mattblair.co).\n\n# Problems\n\n| Algorithm                                                               | Solution                                                                                                                     |\n|--------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|\n| [Binary Heap](http://en.wikipedia.org/wiki/Binary_heap)                   | [code](https://github.com/duereg/js-algorithms/blob/master/lib/dataStructures/binaryHeap.js)                               |\n| [Binary Search Tree](http://en.wikipedia.org/wiki/Binary_search_tree)     | [code](https://github.com/duereg/js-algorithms/blob/master/lib/dataStructures/binarySearchTree.js)  |\n| [Depth First Search](http://en.wikipedia.org/wiki/Depth-first_search)    | [code](https://github.com/duereg/js-algorithms/blob/master/lib/algorithms/4-searching/depthFirstSearch.js) |\n| [Fisher–Yates shuffle](http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) | [code](https://github.com/duereg/js-algorithms/blob/master/lib/algorithms/1-strings/shuffle.js) |\n| [Max Heap](http://en.wikipedia.org/wiki/Binary_heap)                      | [code](https://github.com/duereg/js-algorithms/blob/master/lib/dataStructures/maxHeap.js) |\n| [Mergesort algorithm](https://en.wikipedia.org/wiki/Merge_sort)          | [code](https://github.com/duereg/js-algorithms/blob/master/lib/algorithms/11-sorting/mergeSort.js) |\n| [Min Heap](http://en.wikipedia.org/wiki/Binary_heap)                      | [code](https://github.com/duereg/js-algorithms/blob/master/lib/dataStructures/minHeap.js) |\n| [Queue](http://en.wikipedia.org/wiki/Queue_%28abstract_data_type%29)      | [code](https://github.com/duereg/js-algorithms/blob/master/lib/dataStructures/queue.js)  |\n| [Quicksort algorithm](http://en.wikipedia.org/wiki/Quicksort)            | [code](https://github.com/duereg/js-algorithms/blob/master/lib/algorithms/11-sorting/quickSort.js) |\n| [Stack](http://en.wikipedia.org/wiki/Stack_%28abstract_data_type%29)      | [code](https://github.com/duereg/js-algorithms/blob/master/lib/dataStructures/stack.js)  |\n| [Tower of Hanoi](http://en.wikipedia.org/wiki/Tower_of_Hanoi)            | [code](https://github.com/duereg/js-algorithms/blob/master/lib/algorithms/3-stacks/hanoi.js) |\n| [Trie](http://en.wikipedia.org/wiki/Trie)                                 | [code](https://github.com/duereg/js-algorithms/blob/master/lib/dataStructures/trie.js)  |\n| [Suffix Tree](http://www.allisons.org/ll/AlgDS/Tree/Suffix/)               |[code](https://github.com/duereg/js-algorithms/blob/master/lib/dataStructures/suffixTree.js) |\n| [Basic string compression counting repeated characters](http://codereview.stackexchange.com/questions/65335/basic-string-compression-counting-repeated-characters) | [code](https://github.com/duereg/js-algorithms/blob/master/lib/algorithms/1-strings/compress.js) |\n| [Are two strings permutations of each other](http://stackoverflow.com/questions/2131997/checking-if-two-strings-are-permutations-of-each-other) | [code](https://github.com/duereg/js-algorithms/blob/master/lib/algorithms/1-strings/permutation.js) |\n| [Is a linked list a palindrome](http://www.geeksforgeeks.org/function-to-check-if-a-singly-linked-list-is-palindrome/) | [code](https://github.com/duereg/js-algorithms/blob/master/lib/algorithms/2-linkedLists/palindrome.js) |\n| [Smallest Enclosing Circle](https://www.nayuki.io/page/smallest-enclosing-circle) | [code](https://github.com/duereg/js-algorithms/blob/master/lib/algorithms/4-searching/smallestEnclosingCircle.js)  |\n\n# Description\n\nClassic data structures and algorithms (with tests!) written in JavaScript\n\n* Singly Linked List\n* Min/Max Binary Heap\n* Trie (With Pre-Order Traversal Sorting)\n* Suffix Tree\n* Stack (push, pop, peek, and isEmpty)\n* Queue (add, remove, peek, isEmpty)\n* Binary Search Tree\n* Hash Table\n\nAs well as the following algorithms:\n\n* Breadth First Search\n* Depth First Search\n* Binary Search\n* Merge Sort\n* Quick Sort\n* Shuffle (Fisher–Yates)\n* Smallest Enclosing Circle\n\n## Usage\n\nIf you want access to these data structures in your project, include this package.\n\n```shell\n\u003e const algorithms: = require('js-algorithms')\n\u003e algorithms\n{\n  dataStructures: {\n    binaryHeap: [Function],\n    binarySearchTree: [Function: bst],\n    linkedList: [Function],\n    maxHeap: [Function],\n    minHeap: [Function],\n    queue: [Function],\n    stack: [Function],\n    stackQueue: [Function],\n    trie: [Function],\n    suffixTree: [Function] },\n  algorithms: {\n    sorting: {\n      quickSort: [Function]\n      mergeSort: [Function]\n    },\n    shuffle: [Function],\n    enclosingCircle: [Function]\n  }}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduereg%2Fjs-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduereg%2Fjs-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduereg%2Fjs-algorithms/lists"}