Learning Path: Algorithm Efficiency & Time Complexity Mastery
==============================================================
PHASE 1: Understand Big-O Time Complexity
-----------------------------------------
Goals:
- Learn to read and analyze time/space complexity.
- Recognize common complexities (O(1), O(log n), O(n), O(n log n), O(n²), O(2ⁿ),
etc.)
Topics:
- What is Big-O Notation?
- Best, Average, Worst Case
- Time vs. Space Complexity
Practice:
- Analyze time complexity of code snippets
- LeetCode: https://leetcode.com/tag/time-complexity/
PHASE 2: Master Fundamental Algorithms (with Optimal Complexities)
------------------------------------------------------------------
1. Sorting Algorithms
- Merge Sort, Quick Sort, Heap Sort, Counting Sort
- Practice:
- LeetCode: Sort an Array
2. Searching Techniques
- Binary Search, Binary Search on Answer
- Practice:
- LeetCode: Binary Search, Peak Element
3. Recursion & Backtracking
- Subsets, permutations, N-Queens
- Practice:
- LeetCode: Subsets, Letter Combinations
4. Sliding Window & Two Pointers
- Max/min substring problems, Trapping rain water
- Practice:
- LeetCode: Longest Substring Without Repeating Characters, Minimum Window
Substring
PHASE 3: Dynamic Programming & Greedy
-------------------------------------
5. Dynamic Programming
- Fibonacci, LIS, Matrix DP
- Practice:
- LeetCode: House Robber, Coin Change
6. Greedy Algorithms
- Activity selection, Jump Game
- Practice:
- LeetCode: Jump Game, Merge Intervals
PHASE 4: Graphs & Advanced Optimization
---------------------------------------
7. Graph Algorithms
- BFS, DFS, Dijkstra, Union-Find
- Practice:
- LeetCode: Number of Islands, Course Schedule
8. Bit Manipulation, Tries, Prefix Sums
- XOR tricks, Bitmask DP, Prefix Sum
- Practice:
- LeetCode: Single Number, Maximum XOR
Suggested Weekly Plan
---------------------
Week 1: Big-O & Sorting – 5-10 problems
Week 2: Searching & Recursion – 10 problems
Week 3: Sliding Window & Two Pointers – 10 problems
Week 4: Dynamic Programming – 10–15 problems
Week 5: Greedy & Graph Basics – 10 problems
Week 6: Advanced Graphs, Bit Tricks – 10–15 problems