Computer science is no more about computers than astronomy is about telescopes. — E. W. Dijkstra
- Linked List: traversal, reversal, merging, cycle detection
- Binary Tree: level order(max/min depth, symmetric tree), preorder/inorder/postorder traversal (both recursive and iterative), inversion, lowest common ancestor, merge two binary trees
- Sorting: quick sort, merge sort, insertion sort, selection sort, bubble sort, heap sort
- Binary Search: on sorted arrays, binary trees
- Bit Manipulation Techniques:
- XOR (
^): find numbers that appear only once or twice. - AND (&):
n & (n-1): removes the lowest set bit, commonly used to check if a number is a power of 2.n & -n: gets the lowest set bit.
<<and>>: efficient multiplication and division by 2.- Use XOR to find the unique unpaired number.
- XOR (
- Math Techniques: fast exponentiation, GCD/LCM, elementary math simulation
- Hash table: trading space for time
- Two pointers: fast/slow pointers, left/right pointers (collision pointers), sliding window
- DFS: using a stack
- BFS/backtracking: using a queue
- Dynamic Programming (DP)
- Arrays & Strings
- 1. Two Sum
- 121. Best Time to Buy and Sell Stock
- 189. Rotate Array
- 217. Contains Duplicate
- 238. Product of Array Except Self
- 3. Longest Substring Without Repeating Characters
- 125. Valid Palindrome
- Linked Lists
- 206. Reverse Linked List
- 21. Merge Two Sorted Lists
- 141. Linked List Cycle
- 19. Remove Nth Node From End of List
- 234. Palindrome Linked List
- Stacks & Queues
- Hash Tables
- Binary Search
- 704. Binary Search
- 35. Search Insert Position
- 153. Find Minimum in Rotated Sorted Array
- 33. Search in Rotated Sorted Array
- Dynamic Programming
- 70. Climbing Stairs
- 53. Maximum Subarray
- 322. Coin Change
- 300. Longest Increasing Subsequence
- 72. Edit Distance
- Backtracking
- Trees & Recursion
- 104. Maximum Depth of Binary Tree
- 226. Invert Binary Tree
- 101. Symmetric Tree
- 102. Binary Tree Level Order Traversal
- 235. Lowest Common Ancestor of a BST
- Graphs (BFS & DFS)
- Greedy Algorithms
- Math & Bit Manipulation
This project is dual-licensed:
- Code (Go, Python, etc.): MIT License
- Documentation & Images: CC BY 4.0
Feel free to use, modify, and share this project. Attribution is appreciated! ❤️