Header Ads Widget

what is Asymptotic notation

 Complexity of an algorithm:-    
                                                Complexity of an algorithm is a function ( f(n) ) which gives running time and  or space in the term of input size (n) . 



Asymptotic Notation :-
                                          To select the best algorithm we need to check the efficiency of the each algorithm . Efficiency can be measured by computing the time complexity of each algorithm . Time complexity can be calculated by Asymptotic.



1) Average Case ( Ó¨):-
                                        The theta notation bounds a function from above and below, so it defines exact asymptotic behavior. 
2) Best Case ( 
Ω or Ï‰ ):-  
                                Î© (Omega) describes the best running time of a program. We compute the Ω by counting how many iterations an algorithm will take in the best-case scenario based on an input of N. For example, a linear search will take o(1) running time because in the best case element will find at the first index so the linear search will terminate after finding the element.


 
 3) Worst Case   (Big-o notation):-
                                                           The Big-O notation describes the worst-case running time of a program. We compute the Big-O of an algorithm by counting how many iterations an algorithm will take in the worst-case scenario with an input of N. We typically consult the Big-O because we must always plan for the worst case. 



                           

Recommended Post:

Full C course:-    

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

 MCQs:-