1.9.2 • Published 8 months ago

js-algorithms v1.9.2

Weekly downloads
73
License
-
Repository
github
Last release
8 months ago

NPM version

JS-Algorithms

In case you want to prepare yourself for a job interview, or just need access to common data structures.

I've documented the process of creating this code here.

Problems

AlgorithmSolution
Binary Heapcode
Binary Search Treecode
Depth First Searchcode
Fisher–Yates shufflecode
Max Heapcode
Mergesort algorithmcode
Min Heapcode
Queuecode
Quicksort algorithmcode
Stackcode
Tower of Hanoicode
Triecode
Suffix Treecode
Basic string compression counting repeated characterscode
Are two strings permutations of each othercode
Is a linked list a palindromecode
Smallest Enclosing Circlecode

Description

Classic data structures and algorithms (with tests!) written in JavaScript

  • Singly Linked List
  • Min/Max Binary Heap
  • Trie (With Pre-Order Traversal Sorting)
  • Suffix Tree
  • Stack (push, pop, peek, and isEmpty)
  • Queue (add, remove, peek, isEmpty)
  • Binary Search Tree
  • Hash Table

As well as the following algorithms:

  • Breadth First Search
  • Depth First Search
  • Binary Search
  • Merge Sort
  • Quick Sort
  • Shuffle (Fisher–Yates)
  • Smallest Enclosing Circle

Usage

If you want access to these data structures in your project, include this package.

> const algorithms: = require('js-algorithms')
> algorithms
{
  dataStructures: {
    binaryHeap: [Function],
    binarySearchTree: [Function: bst],
    linkedList: [Function],
    maxHeap: [Function],
    minHeap: [Function],
    queue: [Function],
    stack: [Function],
    stackQueue: [Function],
    trie: [Function],
    suffixTree: [Function] },
  algorithms: {
    sorting: {
      quickSort: [Function]
      mergeSort: [Function]
    },
    shuffle: [Function],
    enclosingCircle: [Function]
  }}
1.9.2

8 months ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.7

3 years ago

1.8.2

3 years ago

1.8.6

3 years ago

1.8.5

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.1

3 years ago

1.5.0

5 years ago

1.4.3

5 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.8

6 years ago

1.3.7

7 years ago

1.3.6

7 years ago

1.3.5

7 years ago

1.3.4

8 years ago

1.3.3

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.4

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.0.0

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago