Master theorem is used to determine the Big – O upper bound on functions which possess recurrence, i.e which can be broken into sub problems.… Read More »
We have discussed Asymptotic Analysis, Worst, Average and Best Cases , Asymptotic Notations and Analysis of loops in previous posts.
Prerequisite : Recursion Memory used by a program is sometimes as important as running time, particularly in constrained environments such as mobile devices. For example… Read More »
It is a well established fact that merge sort runs faster than insertion sort. Using asymptotic analysis we can prove that merge sort runs in… Read More »
For such cases, time complexity of the loop is O(log(log(n))).The following cases analyse different aspects of the problem. Case 1 : In this case, i… Read More »
What is Pseudo-polynomial? An algorithm whose worst case time complexity depends on numeric value of input (not number of inputs) is called Pseudo-polynomial algorithm. For… Read More »
What is the time complexity of below code?
What is the time complexity of below function?
Consider below two C language functions to compute sum of elements in a 2D array. Ignoring the compiler optimizations, which of the two is better… Read More »
What is the time complexity of following function fun()?
Consider the following C function.
Amortized Analysis is used for algorithms where an occasional operation is very slow, but most of the other operations are faster.
What is tail recursion? A recursive function is tail recursive when recursive call is the last thing executed by the function.
In the previous post, we discussed analysis of loops. Many algorithms are recursive in nature.
We have discussed Asymptotic Analysis, Worst, Average and Best Cases and Asymptotic Notations in previous posts.