my implementations of common algorithms and useful data structures
- advanced-data-structures
- graphs
- BFS (breadth first search)
- DFS (depth first search)
- trees
- segment-tree
- tries
- linked lists
- floyd's cycle detection algorithm
- graphs
- backtracking
- nqueens-backtracking
- nqueens-branch_and_bound
- all-paths-in-a-maze
- sudoku-solver
- bit-manipulation
- generateK-SetBits (generates numbers with k bits set in their binary form)
- powerOfTwo (finds the closest power of two to a number in both directions)
- numberOfSetBits (counts the number of set bits in a binary number O(number of set Bits) algorithm )
- combinatronics
- combinations (generates combinations of a string/array)
- permutation (generates permutations of a string/array)
- subsets (generates all possible subsets of a string/array)
- greedy
- 0-1knapsack (classic 0-1 knapsack problem using George Dantzig's greedy approach)
- numbers
- O(sqrt(n)) primality check
- baseconversion (convert a decimal to any base)
- fermats-little-theorem-primality-test (primality test using fermat's little theorem. higher complexity (number of tests) gives higher accuracy)
- fermat's integer factorization
- Pollard Rho Integer factorization
- largest prime factor of a (long long int) number
- sorting
- selectionsort
- bubblesort
- countsort
- mergeSort
- quickSort
- radixsort
- insertionsort
cpp-template (a template for competitions, filled with shorthands and useful macros)