+ 5

What is O(nĀ²) and O(nĀ³) ?

14th Jan 2018, 11:23 AM
Gagan
Gagan - avatar
5 Answers
+ 11
O(nĀ³) is BigOh asymptotic notations Big O is the most commonly used asymptotic notation for comparing algorithms it is the time complexity of any sorting problem which execution time is nĀ³ The running time of the algorithm is as a result of performing a linear operation NĀ² times; So, itā€™s N multiplied by N, multiplied by N. for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) for (int k = 0; k < n; ++k) count++; //@Jeremy I just give an example
14th Jan 2018, 11:31 AM
GAWEN STEASY
GAWEN STEASY - avatar
+ 1
the Big O notation is not just for sorting algorithms
14th Jan 2018, 12:38 PM
Jeremy
Jeremy - avatar
+ 1
These are Asymptotic Notations, The languages that allow us to analyze an algorithm's running time by identifying its behavior as the input size for the algorithm increases. This is also known as an algorithm's growth rate.
14th Jan 2018, 2:55 PM
Shubham Dalal
Shubham Dalal - avatar
+ 1
both are asymptotic notation... but there efficiency is different
15th Jan 2018, 2:55 AM
Siva Ganesh R
Siva Ganesh R - avatar