COMPREHENSIVE STUDY NOTES • COMPUTER SCIENCE
Data Structures & Algorithmic Complexity
1. Asymptotic Analysis & Big-O Notation
Asymptotic analysis characterizes the execution time or space requirement of an algorithm as the input size n grows
toward infinity. Big-O (O) provides an upper bound on worst-case performance.
Notation Complexity Class Canonical Example Algorithm
O(1) Constant Hash Table lookup, Array indexing
O(log n) Logarithmic Binary Search in sorted array
O(n) Linear Linear Search, Unsorted list traversal
O(n log n) Linearithmic Merge Sort, Quick Sort (average case), Heap Sort
O(n²) Quadratic Bubble Sort, Insertion Sort, Selection Sort
O(2ⁿ) Exponential Recursive Fibonacci without memoization
2. Core Data Structures
Abstract Data Type Comparison
• Arrays vs. Linked Lists: Arrays offer O(1) random access but O(n) insertion/deletion. Linked lists offer O(1)
insertion at known pointers but O(n) sequential access.
• Hash Tables: Utilize a hash function to map keys to bucket indices, yielding O(1) average time complexity for
insertion, deletion, and lookup. Collision resolution: Chaining vs. Open Addressing.
• Binary Search Trees (BST): Balanced trees (AVL, Red-Black) guarantee O(log n) time for search, insertion,
and deletion by maintaining height balance factors.
3. Fundamental Graph Algorithms
Graphs G = (V, E) model complex relational data. Primary traversal and pathfinding paradigms include:
Breadth-First Search (BFS)
Uses a First-In-First-Out (FIFO) queue to explore graph level-by-level. Computes shortest path on unweighted graphs in
O(|V| + |E|) time complexity.
Depth-First Search (DFS)
Uses a Last-In-First-Out (LIFO) stack (or call stack recursion) to explore paths deeply before backtracking.
Fundamental for topological sorting and strongly connected components.
Dijkstra's Algorithm
Determines single-source shortest paths on weighted non-negative graphs. Utilizing a min-priority heap, execution time
is O((|V| + |E|) log |V|).
Educational Notes Series • Theoretical Computer Science • Page 1