Data Structures and Algorithms

  1. Algorithms
    1. Analysis of Algorithms
      1. Time Complexity
        1. Big O Notation
          1. Definition and usage
            1. Common classes: O(1), O(n), O(log n), O(n²)
              1. Asymptotic behavior
              2. Big Omega Notation
                1. Definition and contrast with Big O
                  1. Best-case analysis
                  2. Big Theta Notation
                    1. Tight bound analysis
                      1. When to use Big Theta
                    2. Space Complexity
                      1. Memory consumption analysis
                        1. Impact on system resources
                          1. Trade-offs with time complexity
                        2. Searching Algorithms
                          1. Binary Search
                            1. Precondition: sorted data
                              1. Recursive and iterative methods
                                1. Time complexity: O(log n)
                                  1. Applications and scenarios
                                  2. Depth-First Search (DFS)
                                    1. Stack-based or recursive implementation
                                      1. Applications in graph theory
                                        1. Time complexity analysis
                                        2. Breadth-First Search (BFS)
                                          1. Queue-based implementation
                                            1. Shortest path finding
                                              1. Time complexity analysis
                                            2. Sorting Algorithms
                                              1. Bubble Sort
                                                1. Swapping and comparison
                                                  1. Time complexity and optimizations
                                                  2. Selection Sort
                                                    1. In-place comparison sort
                                                      1. Time complexity analysis
                                                      2. Insertion Sort
                                                        1. Incremental data sorting
                                                          1. Adaptive behavior and use cases
                                                          2. Merge Sort
                                                            1. Divide and conquer approach
                                                              1. Time complexity: O(n log n)
                                                                1. Stability and space usage
                                                                2. Quick Sort
                                                                  1. Pivot selection strategies
                                                                    1. Time complexity: average vs. worst case
                                                                      1. In-place sorting and space efficiency
                                                                    2. String Algorithms
                                                                      1. String Matching
                                                                        1. Knuth-Morris-Pratt (KMP)
                                                                          1. Partial match table (prefix function)
                                                                            1. Time complexity: O(n + m)
                                                                            2. Rabin-Karp Algorithm
                                                                              1. Hashing technique
                                                                                1. Spurious hits and rolling hash
                                                                                2. Boyer-Moore Algorithm
                                                                                  1. Bad character rule
                                                                                    1. Good suffix rule
                                                                                      1. Optimal time complexity
                                                                                    2. Tries for String Processing
                                                                                      1. Structure and implementation
                                                                                        1. Applications: autocomplete, spell checking
                                                                                          1. Space complexity and optimization techniques
                                                                                        2. Graph Algorithms
                                                                                          1. Shortest Path Algorithms
                                                                                            1. Dijkstra’s Algorithm
                                                                                              1. Priority queue utilization
                                                                                                1. Time complexity with different data structures
                                                                                                2. Bellman-Ford Algorithm
                                                                                                  1. Handling negative weights
                                                                                                    1. Time complexity: O(VE)
                                                                                                    2. Floyd-Warshall Algorithm
                                                                                                      1. Dynamic programming approach
                                                                                                        1. All pairs shortest path problem
                                                                                                      2. Minimum Spanning Tree
                                                                                                        1. Kruskal’s Algorithm
                                                                                                          1. Union-find data structure
                                                                                                            1. Time complexity analysis
                                                                                                            2. Prim’s Algorithm
                                                                                                              1. Minimum spanning tree using priority queues
                                                                                                                1. Differences with Kruskal’s algorithm
                                                                                                              2. Network Flow Algorithms
                                                                                                                1. Ford-Fulkerson Method
                                                                                                                  1. Augmenting path and flow conservation
                                                                                                                    1. Implementation considerations
                                                                                                                    2. Edmonds-Karp Algorithm
                                                                                                                      1. BFS approach
                                                                                                                        1. Time complexity analysis: O(VE²)
                                                                                                                    3. Dynamic Programming
                                                                                                                      1. Memoization
                                                                                                                        1. Top-down approach
                                                                                                                          1. Recursive state saving
                                                                                                                          2. Tabulation
                                                                                                                            1. Bottom-up approach
                                                                                                                              1. Iterative versus recursive paradigms
                                                                                                                              2. Common Problems
                                                                                                                                1. Fibonacci Sequence
                                                                                                                                  1. Recursive vs. dynamic programming approaches
                                                                                                                                  2. Knapsack Problem
                                                                                                                                    1. 0/1 Knapsack
                                                                                                                                      1. Fractional knapsack and optimization
                                                                                                                                      2. Longest Common Subsequence
                                                                                                                                        1. DP table construction and solution
                                                                                                                                        2. Matrix Chain Multiplication
                                                                                                                                          1. Cost and sequence optimization
                                                                                                                                      3. Greedy Algorithms
                                                                                                                                        1. Characteristics
                                                                                                                                          1. Local optimum choices leading to global optimum
                                                                                                                                            1. Greedy choice property and optimal substructure
                                                                                                                                            2. Common Strategies
                                                                                                                                              1. Activity Selection Problem
                                                                                                                                                1. Scheduling techniques and proofs
                                                                                                                                                2. Huffman Coding
                                                                                                                                                  1. Data compression and tree construction
                                                                                                                                                    1. Prefix-free property and implementation