Skip to content
Programmingoneonone
Programmingoneonone
  • Engineering Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
    • 100+ C++ Programs
  • Solutions
    • HackerRank
      • Algorithms Solutions
      • C solutions
      • C++ solutions
      • Java solutions
      • Python solutions
      • Data Structures Solutions
    • Leetcode Solutions
    • HackerEarth Solutions
  • Work with US
Programmingoneonone
Programmingoneonone

Big Theta Notation in Data Structure | DSA Tutorials

YASH PAL, 6 May 20266 May 2026

The lower and upper bound for the function f is provided by the big theta notation (Θ\Theta).

Big Theta (Θ\Theta) Notation – Definition

Considering g to be a function from the non-negative integers into the positive real numbers. The Θ\Theta(g) = O(g) ∩\cap Ω\Omega(g), that means, the set of functions that are both in O(g) and Ω\Omega(g). The Θ\Theta(g) is the set of functions f such that for some positive constants c1 and c2, and an n0 exists such that c1g(n) <= f(n) <= c2g(n) for all n, n>= n0. By f ∈\in Θ\Theta(g) means f is of order g.

Constant Function

Consider the following constant functions:

  • f(n) = 16
  • f(n) = 27
  • f(n) = 1627

Then, for satisfying the big theta condition, the above functions can be expressed as:

15 * 1 <= f(n) <= 16 * 1, where c1 = 15, c2 = 16 and n0 = 0, So f(n) = Θ\Theta(1) for the above function.
26 * 1 <= f(n) <= 27 * 1, where c1 = 26, c2 = 27 and n0 = 0, So f(n) = Θ\Theta(1) for the above function.
1626 * 1 <= f(n) <= 1627 * 1, where c1 = 1626, c2 = 1627 and n0 = 0, So f(n) = Θ\Theta(1) for the above function.

Linear Function

Consider the following linear functions.

  • f(n) = 3n + 5
  • f(n) = 2n + 3
  • f(n) = 7n + 5

f(n) = 3n + 5
3n < 3n + 5 for all ‘n’. {c1 = 3}
also, 3n + 5 <= 4n for n >= 5, c2 = 4, n0 = 5
thus,
3n < 3n + 5 <= 4n for c1 = 3, c2 = 4, n0=5
Thus, f(n) = Θ\Theta(n)

f(n) = 2n + 3
2n < 2n + 3 for all ‘n’. {c1 = 2}
also, 2n + 3 <= 3n for n >= 3, c2 = 3, n0 = 3
Thus, f(n) = Θ\Theta(n)

f(n) = 7n + 5
7n < 7n + 5 for all ‘n’. {c1 = 7}
also, 7n + 5 <= 8n for n >= 5, c2 = 8, n0 = 5
Thus, f(n) = Θ\Theta(n)

Quadratic Function

Consider the following quadratic functions:

  • f(n) = 27n2 + 16n
  • f(n) = 27n2 + 16
  • f(n) = 10n2 + 7

f(n) = 27n2 + 16n
27n2 < 27n2 + 16n, for all n, {c1 = 27}.
also
27n2 + 16n <= 28n2 for n >= n0 = 16, c2 = 28
thus, 27n2 <= 27n2 + 16n <= 28n2 for c1 = 27, c2 = 28, n0 = 16
So, f(n) = Θ\Theta(n2)

f(n) = 27n2 + 16
27n2 < 27n2 + 16, for all n, {c1 = 27}.
also
27n2 + 16 <= 28n2 for n >= n0 = 16, c2 = 28
thus, 27n2 <= 27n2 + 16 <= 28n2 for c1 = 27, c2 = 28, n0 = 8
So, f(n) = Θ\Theta(n2)

f(n) = 10n2 + 7
10n2 < 10n2 + 7, for all n, {c1 = 10}.
also
27n2 + 7n <= 11n2 for n >= n0 = 7, c2 = 11
thus, 10n2 <= 10n2 + 7 <= 11n2 for c1 = 10, c2 = 11, n>=n0 = 7
So, f(n) = Θ\Theta(n2)

Cubic Function

Consider the following cubic functions:

  • f(n) = 2n3 + n2 + 2n
  • f(n) = 4n3 + 2n + 3

f(n) = 2n3 + n2 + 2n
2n3 < 2n3 + n2 + 2n, for all n>= n0, {c1=2}
also, 2n3 + n2 + 2n <= 3n3, for all n>= n0 = 2, {c2=3}
thus, 2n3 < 2n3 + n2 + 2n <= 3n3, for all n>= n0 = 2, c1=2, c2=3
So, f(n) = Θ\Theta(n2)

f(n) = 4n3 + 2n + 3
4n3 < 4n3 + 2n + 3, for all n, {c=4}
So, f(n) = Θ\Theta(n2)

Exponential Function

Consider the following exponential functions:

  • f(n) = 2n + 6n2 + 3n
  • f(n) = 4 * 2n + 3n

f(n) = 2n + 6n2 + 3n
2n < 2n + 6n2 + 3n, for all n>= n0, {c1=1}
also 2n + 6n2 + 3n <= 8 * 2n for all n>= n0 >= 4, {c2=8}
thus 2n < 2n + 6n2 + 3n <= 8 * 2n, for all n>= n0, {c1=1, c2 = 8}
So, f(n) = Θ\Theta(2n)

f(n) = 4 * 2n+ 3n
4 * 2n < 4 * 2n + 3n, for all n>= n0, {c1=4}
also 4 * 2n + 3n <= 7 * 2n for all n>= n0 >= 1, {c2=7}
thus 4 * 2n < 4 * 2n + 3n <= 7 * 2n, for all n>= n0 = 1, {c1=4, c2 = 5}
So, f(n) = Θ\Theta(2n)


Data Structures & Algorithms Tutorials for Beginners
Data Structures Tutorials DSA Tutorials

Post navigation

Previous post
Next post

Programmingoneonone

We at Programmingoneonone, also known as Programming101 is a learning hub of programming and other related stuff. We provide free learning tutorials/articles related to programming and other technical stuff to people who are eager to learn about it.

Pages

  • About US
  • Contact US
  • Privacy Policy

Practice

  • Java
  • C++
  • C

Follow US

  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2026 Programmingoneonone | WordPress Theme by SuperbThemes