May 2017
Intermediate to advanced
310 pages
8h 5m
English
Now consider a problem of magnitude n. To determine the time complexity of an algorithm, we denote it with T(n). The value may fall under O(1), O(log n), O(n), O(n log(n)), O(n2), O(n3), or O(2n). Depending on the steps an algorithm performs, the time complexity may or may not be affected. The notation O(n) captures the growth rate of an algorithm.
Let's now examine a practical scenario. By which means do we arrive at the conclusion that the bubble sort algorithm is slower than the quick sort algorithm? Or in general, how do we measure the efficiency of one algorithm against the other? Well, we can compare the Big O of any number of algorithms to determine their efficiency. It is this approach that gives us a time measure ...