My implementation of various types of algorithms and data structures.
- AVL tree, O(log(n)) insertion and O(n) space complexity
- 2D grid traveler, O(n*m) time and space complexity
- longest increasing subsequence problem, O(2^n) time complexity and O(n) space complexity (better is possible)
- subset sum problem, O(2^n) time and O(n) space complexity (better is possible)
- primality testing, O(sqrt(n)) time complexity and O(1) space complexity, deterministic approach for large n
- permutations, O(n!) time and space complexity.
- binary search, worst case on ordered arrays is O(log(n)) time and O(1) space complexity
- depth-first search, worst case O(n + e) where e is the number of edges in tree and O(n) space complexity (see nodetree data structure)
- breadth-first search, worst case O(n + e) where e is the number of edges in tree and O(n) space complexity (see nodetree data structure)
- bubble sort, worst case O(n^2) time complexity and O(1) space complexity
- heap sort, worst case O(nlog(n)) time complexity and O(1) space complexity
- merge sort, worst case O(nlog(n)) time complexity and O(n) space complexity
- quick sort, worst case O(nlog(n)) time complexity and O(1) space complexity
- O(nlog(n)) solution for longest increasing subsequence problem
- O(n) solution for subset sum problem
- nth-Fibonacci in O(log(n)) time complexity