PCCST303 · Module 1: Basic Concepts of Data Structures
Asymptotic Notations
KTU PYQ
KTU PYQ, 6 marks: "Describe different notations used to express the time complexity of an algorithm."
Asymptotic notation describes the growth of an algorithm's running time rather than its exact runtime. There are three standard notations, O, Ω, and Θ.
O: upper bound
iff there exist positive constants and such that for all .
For example, for f(n) = 2n + 3, taking c = 5 gives for all , so f(n) = O(n).
Ω: lower bound
iff there exist positive constants and such that for all .
For example, for f(n) = 2n + 3, taking c = 1 gives for all , so f(n) = Ω(n).
Θ: tight bound
iff there exist positive constants , , and such that for all .
For example, for f(n) = 2n + 3, the O and Ω results above already give for , so f(n) = Θ(n) with , .
Key Idea
Covering all three notations, O, Ω, and Θ, with a clear definition, graph, and example for each, is what separates a full-marks answer from a partial one. See the Asymptotic Notations lesson for the strict variants o() and ω().