Data Structures

What is Asymptotic Analysis? Data Structures Tutorial

What is Asymptotic Analysis? Data Structures Tutorial

What is Asymptotic Analysis? Data Structures Tutorial

In this article, you will get to know about the asymptotic analysis in the data structures. You will also learn about Big-O notation, Theta notation, and omega notation.

The efficiency of an algorithm depends on the quantity of time, storage, and other resources required to execute the algorithm. With the help of asymptotic notations, we can measure the efficiency. An algorithm may have different performance for different types of inputs. The performance rate will always change with the expanded size of input. The rate of change in performance of the algorithm with the change in the order of the input size is also known as asymptotic analysis. 

Asymptotic Notations:

Asymptotic notations are the mathematical notations that are used in describing the running time of an algorithm when the input leans towards an obligated value. 

Example: When the input array is in reverse order, the algorithm takes the maximum time to sort the array element. i.e it comes under the worst case scenario. When the input array is neither sorted nor in the reverse order, then it takes the average time. These durations are denoted with the help of asymptotic notations. 

The three asymptotic notations are:

  • Big-O Notation
  • Omega Notation
  • Theta Notation

Big-O Notation (O-notation)

Big-O notation is the upper bound of the running time of an algorithm. Thus, it gives the worst-case complexity of an algorithm.

O(g(n)) = { f(n): there exist positive constants c and c0 such that 0 <= f(n) <=c*g(n) for all c>=c0}

Omega Notation 

Omega Notation is the lower bound of the running time of an algorithm. Thus, it provides the best case scenario of an algorithm.

Omega(g(n)) = { f(n) : there exist positive constants c and n0 such that 0<=c*g(n) <=f(n) for all n>=n0 }

Theta Notation

Theta Notation represents the function from above and below. Since it represents the upper and the lower bound of the running time of an algorithm, it is used to analyze the average-case scenario of an algorithm.

Theta(g(n)) = { f(n) : there exist positive constants c1, c2, and n0 such that 0<= c1*g(n) <= f(n) <= c2*g(n) for all n>=n0 }

Yamini  Sharma

I am working as a professional engineer in "HIghRadius Technologies Pvt. Ltd." Passionate about learning and exploring new technologies. Enthusiast in writing and sharing what I have in my knowledge bucket.