- Objective: Understand core concepts of data structures and algorithms to solve computational problems efficiently.
- Pre-requisites: Basic understanding of a programming language and mathematical concepts like logarithms and modular arithmetic.
-
Time and Space Complexity
- Big-O, Big-Θ, and Big-Ω Notations
- Analyze iterative and recursive functions
-
Mathematics for DSA
- Modular Arithmetic
- GCD (Euclid’s Algorithm)
- Exponentiation (Power functions, Modular Exponentiation)
-
Arrays:
- Traversal, Insertion, Deletion
- Prefix Sums, Sliding Window
- Kadane’s Algorithm (Maximum Subarray Sum)
-
Strings:
- String Matching (KMP Algorithm, Rabin-Karp)
- Anagrams, Palindromes
- Z Algorithm
- Two Sum Problem
- Longest Palindromic Substring
-
Singly Linked List
- Insertion, Deletion, Traversal
- Detect Cycle (Floyd’s Cycle Detection)
-
Doubly Linked List
-
Circular Linked List
- Reverse a Linked List
- Merge Two Sorted Linked Lists
-
Stacks:
- Next Greater Element
- Evaluate Postfix/Prefix Expressions
-
Queues:
- Circular Queue
- Deque (Double-Ended Queue)
- Implement Min Stack
- Sliding Window Maximum
-
Binary Tree:
- Traversals (Inorder, Preorder, Postorder)
- Diameter of a Tree
- Lowest Common Ancestor (LCA)
-
Binary Search Tree (BST):
- Insertion, Deletion, Search
- Balanced BSTs (AVL Trees, Red-Black Trees)
-
Heaps:
- Min-Heap and Max-Heap
- Heap Sort
- Convert Sorted Array to BST
- Binary Tree Level Order Traversal
-
Representations: Adjacency Matrix, Adjacency List
-
Traversal Algorithms:
- Depth First Search (DFS)
- Breadth First Search (BFS)
-
Shortest Path Algorithms:
- Dijkstra's Algorithm
- Bellman-Ford
-
Minimum Spanning Tree (MST):
- Kruskal’s Algorithm
- Prim’s Algorithm
-
Topological Sorting
- Detect Cycle in a Graph
- Clone a Graph
-
Sorting:
- Bubble, Selection, Insertion Sort
- Quick Sort, Merge Sort, Heap Sort
-
Searching:
- Linear Search, Binary Search
- Applications of Binary Search (First and Last Occurrence)
- Search in Rotated Sorted Array
- Find Median in a Sorted Array
-
Basics of Recursion
- Factorial, Fibonacci, Power Functions
-
Backtracking:
- N-Queens Problem
- Rat in a Maze
- Subset Sum
- Generate Parentheses
- Word Search in a Grid
-
Basics:
- Recursion to DP Transition
- 0/1 Knapsack, Subset Sum
-
Advanced DP:
- Longest Common Subsequence (LCS)
- Longest Increasing Subsequence (LIS)
- Matrix Chain Multiplication
- Edit Distance
- Minimum Path Sum
-
Tries:
- Insert and Search
- Longest Prefix Matching
-
Segment Trees:
- Range Queries
- Lazy Propagation
-
Fenwick Tree (Binary Indexed Tree)
- Count Inversions using BIT
- Range Sum Queries
-
Basics of Bits
- AND, OR, XOR Operations
- Bit Masking
-
Applications:
- Subset Generation
- Count Set Bits
- Single Number Problem
- Power of Two
- Divide and Conquer
- Sliding Window Technique
- Two Pointers
- Maximum Product Subarray
- Container with Most Water
- Start small: Solve basic problems before tackling harder ones.
- Debug efficiently: Use print statements or debugging tools to trace your logic.
- Consistency: Practice daily to build strong problem-solving skills.