DSA Part 1: Introduction | ahampriyanshu

Table of Contents

Asymptotic Notations

Time taken by a program is always +ve. Input provided is also always +ve.

Hence, analysis of an algorrithm is done always in the first quadrant.

Big-O Notation

Big-Ω Notation

Big-Θ Notation

Complexity analysis of a problem

Steps to approach a problem

Sometimes instead of reading the problem statement, we can find required logic by observing the pattern in sample input and output. {: .prompt-tip }

Analyzing given constraints

Conventionally, we can perform 4.108 operation in one second.

Complexity Table

NT.C.
1018$O(logN)$
108$O(N)$
104$O(N^2)$
107$O(N \cdot logN)$
102$O(N^3)$
90$O(N^4)$
20$O(2^N)$
11$O(N!)$

Possible verdicts