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

# Tag Archives: Algorithms-Analysis of Algorithms (Recurrences)

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) filter_none edit close play_arrow link brightness_4 code int recursive… Read More

What is the time complexity of the following recursive function: filter_none edit close play_arrow link brightness_4 code int DoSomething (int n) { if (n <=… Read More

The running time of the following algorithm Procedure A(n) If n

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

Suppose T(n) = 2T(n/2) + n, T(0) = T(1) = 1 Which one of the following is false. ( GATE CS 2005) a) T(n) =… Read More

What is the worst case time complexity of following implementation of subset sum problem. filter_none edit close play_arrow link brightness_4 code // Returns true if… 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

What is the value of following recurrence. T(n) = T(n/4) + T(n/2) + cn2 T(1) = c T(0) = 0 Where c is a positive… Read More