Lect-1: Introduction to Algorithm
Analysis
Dr. Rajendran Swamidurai
Spring 2026
Introduction to Algorithm Analysis
• Objective: To understand how to predict the resources (time and
storage) an algorithm requires and to compare the efficiency of
different algorithms independently of hardware or implementation
details.
Why Analyze Algorithms?
We analyze algorithms to answer the question: "How does the
performance of this algorithm change as the input size grows?"
• Scalability: An algorithm that works fast on 10 items might freeze on
1,000,000 items. Analysis helps us predict this behavior.
• Hardware Independence: We want a metric that doesn't depend on the
speed of the computer, the programming language, or the compiler.
• Trade-offs: Analysis helps us decide between Time Complexity (speed)
and Space Complexity (memory usage).
The RAM Model of Computation
• To analyze algorithms mathematically, we use a simplified model
of a computer called the Random Access Machine (RAM) model:
• Single Processor: Instructions are executed one after another.
• Uniform Cost: Basic operations (addition, subtraction, assignment,
accessing a variable) take constant time, denoted as O(1).
• Infinite Memory: We assume we don't run out of RAM (though we track
how much we use).
Asymptotic Analysis (The "Big" Notations)
• We focus on asymptotic efficiency, which means looking at the
running time T(n) as the input size n approaches infinity (n → ∞).
We ignore lower-order terms and constant factors because they
become insignificant for large n.
• Big O
• Big Omega
• Big Theta
Common Complexity Classes
How to Calculate the Complexity?
Best, Average, and Worst Case