/cs

A bunch of cool things written in C++.

Primary LanguageC++MIT LicenseMIT

Algorithms & Data Structures

Algorithms

  • merge sort, heapsort, quicksort, insertion sort, selection sort, bubble sort
  • counting sort, radix sort, bogo sort :(
  • topological sorting
  • binary and linear search
  • sieve of Eratosthenes
  • DFS, BFS, iterative DFS
  • fast binary exponentiation
  • convert from decimal to whatever
  • find cycles in a DAG
  • Dijkstra!
  • generating a powerset using bitmasks
  • Wagner–Fischer algorithm (edit distance)
  • find all divisors in sqrt(n) time

Data Structures

  • a very simple doubly linked list
  • adjacency matrix and list
  • simple stack, queue
  • simple max-heap and min-heap
  • BST
  • Huffman tree
  • very simple segment tree