Module 1 – Advanced Data Structures & Analysis
(Quick Revision Notes)
Data Structures
• Definition: Way of organizing & storing data for efficient access/modification.
• Types:
• - Linear: Array (fixed size, same type), Linked List (nodes with pointers), Stack (LIFO), Queue
(FIFO).
• - Non-Linear: Tree (hierarchical, e.g., BST), Graph (nodes + edges).
Algorithm Analysis
• Goal: Evaluate efficiency (time & space).
• Why important? Predict performance, compare algorithms, choose best.
• Complexities:
• - Time Complexity: O(1), O(log n), O(n), O(n log n), O(n²)…
• - Space Complexity: Input space + Auxiliary space. Important in memory-limited systems.
Growth of Functions
• Shows how runtime/memory grows with input size.
• Order: 1 < log n < n < n log n < n² < 2■ < n!
Asymptotic Notations
• Big-O (O): Upper bound → Worst case.
• Omega (Ω): Lower bound → Best case.
• Theta (Θ): Tight bound → Average case.
Recurrence Relations
• Define terms using previous terms → Used in recursive algorithms.
• Types:
• - Linear: e.g., T(n)=T(n-1)+T(n-2)
• - Divide & Conquer: e.g., T(n)=3T(n/2)+9n
• - First Order: depends only on last term.
• - Higher Order: depends on multiple previous terms.
• Solving Methods:
• - Substitution Method (Forward/Backward, guess & verify).
• - Recursion Tree Method (expand into tree, sum cost at levels).
• - Master Method (direct formula for divide & conquer recurrences).