Skip to content

davidxk/Algorithm-Implementations

Repository files navigation

Algorithm Implementations

My implementations of classic algorithms and data structures in Python, C, C++ and Java.

Features

  • Tests included
  • Clean code
  • In 4 major programming languages

Data Structures

  • Vector
  • Hash Set
  • Binary Search Tree
  • Heap
  • Disjoint Set (Union-Find)
  • Trie
  • Segment Tree
  • Binary Indexed Tree

Algorithms

Category Algorithms
search binary search, bisect
sorting bubble sort, selection sort, merge sort, heap sort, quick sort, k-way merge sort
selection quick select, BFPRT select
linked list find middle, reverse linked list, cycle detection, merge sort
stack next greater
tree traversal recursive, stack, Morris
minimal spanning tree Prim's, Kruskal's
graph connected component, bipartite test, tree test
shortest path bfs, Dijkstra's, Bellman–Ford, SPFA, Floyd–Warshall, Johnson's
graph search bidirectional, depth limited, iterative deepening
topological sort Kahn's, DFS-based, Viterbi shortest path
recursion permutations, combinations, subsets, partitions
string naive string matcher, KMP string matcher
math gcd, extended gcd, CRT
majority Boyer–Moore majority vote
sampling selection-rejection, reservoir sampling, weighted sampling
shuffle Fisher–Yates
dutch national flag three way partition

About

Algorithm and data structure implementations in Python, C, C++ and Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published