Algorithm Time Complexity Analysis

Test your knowledge of time complexity analysis using recurrence relations and algorithmic complexity for algorithms like Kruskal's and Prim's

25 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=3T(n/4)+c(n2)

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 2 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=(n - 1)+n

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 3 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=2T(n/2)+c

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 4 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)= 2T(n/2)+n

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 5 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=2T(n/2+17)+O(n)

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 6 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=T(n/3)+T(2n/3)+O(n)

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 7 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=3T(n/4)+nlogn

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 8 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=9T(n/3)+n

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 9 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=T(2n/3)+1

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 10 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=T(n-1)+1/n

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 11 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=4T(n/2)+n2√n

  1. O(n2√n)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 12 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=2T(n/2)+n/logn

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(nloglog n)
Question 13 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=T(n/2)+T(n/4)+T(n/8)+n

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 14 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=3T(n/2)+nlogn

  1. O(n2)
  2. O(nlog 3)
  3. O(n)
  4. O(log n)
Question 15 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=T(n-1)+logn

  1. O(n2)
  2. O(n log n)
  3. O(n)
  4. O(log n)
Question 16 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=T(n-2)+2logn

  1. O(n2)
  2. O(nlog3)
  3. O(n)
  4. O(log n)
Question 17 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=2T(√n)+logn

  1. O(n2)
  2. O(nlog3)
  3. O(lognloglogn)
  4. O(log n)
Question 18 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=2T(n-1)+1

  1. O(n2)
  2. O(nlog3)
  3. O(2n)
  4. O(log n)
Question 19 Multiple Choice (Single Answer)

The time required by Kruskal's algorithm is _____.

  1. O(|E|log|V|)
  2. O(VlogE)
  3. O(EV)
  4. O(log V)
Question 20 Multiple Choice (Single Answer)

The time required by Prim's algorithm is ______.

  1. O(|V|2)
  2. O(VlogE)
  3. O(EV)
  4. O(log V)
Question 21 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=T(n-1)+n+c

  1. O(n2)
  2. O(nlog3)
  3. O(2n)
  4. O(log n)
Question 22 Multiple Choice (Single Answer)

In Prim's algorithm, it will be reduced to _________ if heap is used to keep.

  1. O(|E|log|V|)
  2. O(VlogE)
  3. O(EV)
  4. O(log V)
Question 23 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

2T(n/2)+n2

  1. O(n2)
  2. O(nlog3)
  3. O(2n)
  4. O(log n)
Question 24 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=T(n/4)+2T(n)+n2

  1. O(n2)
  2. O(nlog3)
  3. O(2n)
  4. O(log n)
Question 25 Multiple Choice (Single Answer)

Directions: Find the time complexities of the following question.

T(n)=2T(√n)+nlogn+n

  1. Ω(n2)
  2. Ω(nlog3)
  3. Ω(2n)
  4. None of these