Data structure algorithm implementations for learning in various programming languages
Category | Algorithm | Javacsript | Java | Python |
---|---|---|---|---|
Union-Find | Weighted Quick-Union UF | β | β | |
Sort | Knuth Shuffle | β | ||
Sort | Insertion Sort | β | ||
Sort | Mergesort | β | ||
Sort | Quicksort | β | ||
Binary Heap | Priority Queue | β | ||
Binary Heap | Heapsort | β | ||
Linked List | Singly Linked List | β | ||
Tree | BinaryTree | β | ||
Tree | BinarySearchTree | β |
- π javascript/
- π union_find/
- π weighted_quick_union_uf.js:
UnionFind
with improvements:- β Quick-Union algorithm
- β Weighted sub-trees
- β Path compression
- π weighted_quick_union_uf.js:
- π sort/
- π sortable.js: Base class with common utility methods for array-based sorting algorithms.
- π knuth_shuffle.js:
Knuth shuffle
algorithm for arrays. - π insertionsort.js:
Insertion sort
algorithm for arrays. - π mergesort.js:
Mergesort
algorithm for arrays with improvements:- β Insertion Sort for smaller subarrays
- β Stop early if already sorted
- π² Eliminate copy of auxiliary array
- π quicksort.js:
Quicksort
algorithm for arrays with improvements:- β Initial shuffle for performance guarantee
- β Insertion Sort for smaller subarrays
- β Median-of-3-samples to find optimal partition element
- π binary_heap/
- π priority_queue.js:
Priority Queue
implementation using aBinary Heap
data-structure. - π heap_sort.js:
Heapsort
implementation using aBinary Heap
data-structure.
- π priority_queue.js:
- π linked_list/
- π linked_list.js: A
singly-linked-list
implementation.
- π linked_list.js: A
- π tree/
- π binary_tree.js:
BinaryTree
class implementation. - π binary_search_tree.js:
BinarySearchTree
class implementation by extending theBinaryTree
class.
- π binary_tree.js:
- π union_find/