+ 5
What is O(nĀ²) and O(nĀ³) ?
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
+ 1
the Big O notation is not just for sorting algorithms
+ 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.
+ 1
both are asymptotic notation... but there efficiency is different