January 2018
Intermediate to advanced
332 pages
7h 36m
English
Until now, we have seen some examples that are pretty straightforward: they all have a single loop or nested loops. However, a lot of times, there will be scenarios in which we will have to handle multiple loops/function calls/branches originating from the same algorithm. Let us see an example of how we can calculate the complexity in that case?
function xyz() { abc(); // O(n) operation pqr(); // O(log(n)) operation }
The collective complexity of this code would be the summation of the complexity of both the sections. So, in this case, ...
Read now
Unlock full access