Skip to content

Tag Archives: Algorithms-Analysis of Algorithms (Recurrences)

The Recursion Tree Method is a way of solving recurrence relations. In this method, a recurrence relation is converted into recursive trees. Each node represents… Read More
Prerequisite: Analysis of Algorithms | Big-O analysis In the previous article, the analysis of the algorithm using Big O asymptotic notation is discussed. In this… Read More
A recurrence relation is an equation that recursively defines a sequence or multidimensional array of values, once one or more initial terms are given; each… Read More
Consider the following recurrence. T(n) = T() + What is the value of recurrence? (A) (B) (B) (B) (A) A (B) B (C) C (D)… Read More
Consider the following recurrence T(n) = 3T(n/5) + lgn * lgn What is the value of T(n)? (A) (B) (c) (D) (A) A (B) B… Read More
The time complexity of the following C function is (assume n > 0 (GATE CS 2004) int recursive (mt n) {    if (n == 1)… Read More
What is the time complexity of the following recursive function: int DoSomething (int n)  {   if (n <= 2)     return 1;   else       return (DoSomething (floor(sqrt(n)))… Read More
The running time of an algorithm is represented by the following recurrence relation: if n <= 3 then T(n) = n else T(n) = T(n/3)… Read More
Consider the following recurrence: Which one of the following is true? (A) T(n) = (loglogn) (B) T(n) = (logn) (C) T(n) = (sqrt(n)) (D) T(n)… Read More
What is the worst case time complexity of following implementation of subset sum problem. // Returns true if there is a subset of set[] with… Read More
What is the value of following recurrence. T(n) = 5T(n/5) + , T(1) = 1, T(0) = 0 (A) Theta (n) (B) Theta (n^2) (C)… Read More