Lot of students get confused while understanding the concept of time-complexity, but in this article we will explain it with a very simple example: Imagine… Read More »
Iterated Logarithm or Log*(n) is the number of times the logarithm function must be iteratively applied before the result is less than or equal to… Read More »
The Fibonacci numbers are the numbers in the following integer sequence 0, 1, 1, 2, 3, 5, 8, 13… Mathematically Fibonacci numbers can be written… Read More »
Master theorem is a direct way to get the solution of a recurrence relation, provided that it is of the following type: T(n) = aT(n/b)… Read More »
An online algorithm is one that can process its input piece-by-piece in a serial fashion, i.e., in the order that the input is fed to… Read More »
The main idea of asymptotic analysis is to have a measure of efficiency of algorithms that doesn’t depend on machine specific constants, mainly because this… Read More »
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 »