Difference between revisions of "Interview Preparation Big O notation"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Created page with "For a example, f(n) = n^5 + n. As we go on increasing the value of n the dependency on the second half equation on the right-hand side will reduce. so, we can also say that...")
 
 
Line 1: Line 1:
 +
Big O notation is a mathematical way of representing an approximate time required for an expression to complete by checking for its major dependencies.
 +
 
For a example, f(n) = n^5 + n.
 
For a example, f(n) = n^5 + n.
  
Line 6: Line 8:
  
 
Note: For comparison of big O complexity for different algorithms, refer following site:  http://bigocheatsheet.com/
 
Note: For comparison of big O complexity for different algorithms, refer following site:  http://bigocheatsheet.com/
 
=== Source Code ===
 
*  [https://gitlab.com/Khanna_Bharat/Data_Structure Gitlab Source Code Link]
 

Latest revision as of 01:48, 19 December 2016

Big O notation is a mathematical way of representing an approximate time required for an expression to complete by checking for its major dependencies.

For a example, f(n) = n^5 + n.

As we go on increasing the value of n the dependency on the second half equation on the right-hand side will reduce.

so, we can also say that f(n) = n^5 or complexity is O(n^5) for n equal to infinity.

Note: For comparison of big O complexity for different algorithms, refer following site: http://bigocheatsheet.com/