Algorithms let us think about computation independently of the limitations of a computer or programming language.

  1. ๐Ÿ” Binary Search efficiently finds a target in a sorted list by halving the search range each step.
  2. ๐Ÿ‘‰๐Ÿ‘ˆ Two Pointers uses two indices moving toward each other (or in tandem) to solve array problems in linear time.
  3. ๐Ÿ”€ Sorting reorganizes elements into a specified order (e.g. ascending) using algorithms like quicksort or mergesort.
  4. ๐ŸชŸ Sliding Window maintains a window over a sequence to compute metrics (sum, max, etc.) for all subarrays of fixed size in .
  5. โž• Prefix Sums precomputes cumulative sums, allowing us to query any subarray total in constant time.
  6. โ™พ๏ธ Recursion solves problems by having functions call themselves on progressively smaller inputs, often simplifying divideโ€‘andโ€‘conquer.
  7. ๐Ÿ’ง Breadth First Search explores a graph level by level, ideal for finding shortest paths in unweighted graphs.
  8. ๐ŸšŸ Depth First Search dives deep along one branch before backtracking, useful for connectivity and topological sort.
  9. ๐Ÿ”„ Dynamic Programming breaks problems into overlapping subproblems, caching results to avoid redundant work.
  10. ๐Ÿ—บ๏ธ Dijkstraโ€™s Algorithm finds shortest paths from a source in a non-negative weighted graph using a priority queue.
  11. ๐Ÿšข Primโ€™s and Kruskalโ€™s Algorithm greedily builds a minimum spanning tree by selecting the lightest edges without creating cycles.
  12. ๐Ÿฅฝ Union-Find manages disjoint sets with nearโ€‘constant time union and find operations (useful for connectivity).
  13. ๐Ÿƒ Randomized Search Tree employs randomness to simplify solutions or improve expected performance on average.

Data Structures

  1. ๐Ÿ“ Hashmaps store keyโ€“value pairs for average lookup, insertion, and deletion.
  2. ๐Ÿฝ๏ธ Stacks provide a LIFO structure supporting push and pop at one end, handy for backtracking and parsing.
  3. ๐Ÿ Queues provide a FIFO structure supporting enqueue at rear and dequeue from front, ideal for BFS.
  4. โ›“๏ธ Linked Lists provide a sequence of nodes where each node points to the next, allowing insertion/deletion with a pointer.
  5. ๐Ÿ“Š Graphs model entities (nodes) and their relationships (edges), foundational for network and connectivity problems.
  6. ๐ŸŒณ Binary Search Trees are binary trees where left child < node < right child, giving search on average.
  7. โ›ฐ๏ธ Heaps are a treeโ€‘based priority queue that lets us extract the max (or min) in .
  8. ๐Ÿ”ด Red-Black Tree is a selfโ€‘balancing BST ensuring ) operations by enforcing color and rotation invariants.
  9. โ˜ฎ๏ธ AVL Tree is a heightโ€‘balanced BST with strict balance factor, guaranteeing in worst case.
  10. ๐ŸŽฒ Treap is a randomized BST combining heap priorities with BST keys to maintain balance probabilistically.
  11. ๐Ÿ“ K-Dimensional Trees partition kโ€‘dimensional points recursively, useful for nearest neighbor searches.
  12. ๐Ÿ“‚ B-Trees and B+ Trees provide wide, multiโ€‘way trees optimized for disk and block storage, minimizing I/O operations.