Complexity Analysis

 1) Complexity Analysis










Compiler is working on RAM . Every program will be stored in RAM.


2) Sum of numbers














Time is a factor in complexity analysis , according to the complexity of code, it will take that much time to execute.

More the #of input , higher is the space and time.


3) Time complexity and space complexity









4) log formulas











5) Problem 

Here AP1, AP2 etc stands for Approach 1 , Approach 2 etc.

















N>P>G>A, best solution tales less time or less space and it is called optimized solution.










There exist some approach where time will be lower and space is higher and it is called optimized time complexity

and there exist some approach time will be higher and space is lower and it is called optimized space complexity.


Comments