Complexity
Complexity
• Example code:
T(n)=O(n2)
An algorithm with this running time is known as quadratic
running time.
This means that whenever you increases the size of the
input by a factor of n, the running time increases by a
factor of n2.
execution time increases with the squire of the number of items you have.
O(n2) means if the size of the problem doubles then four
time as much storage or time will be needed.
Example:
O(nlogn)