Avatto > UGC NET COMPUTER SCIENCE > PRACTICE QUESTIONS > Data Structures and Algorithms > Performance Analysis of Algorithms and Recurrences

Data Structures and Algorithms MCQ - Performance Analysis of Algorithms and Recurrences

Correct AnswerOption D
Rate difficulty Rate difficulty:
Choose a difficulty.

Given,
f (n) = O (g (n))
g (n) ≠ O (f (n))
g (n) = O (h (n))
h (n) = O (g (n))
So conclusion is
f (n) < g (n) = h (n) { in terms of growth rate}
So
(A) f (n) + g (n) = O (h(n) + h (n)) is true.
(B) f (n) = O (h (n)) is true.
(C) h (n) ≠ O (f (n)) is true.
(D) f (n) * h(n) ≠ O (g(n) * h (n) is false.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption A
Rate difficulty Rate difficulty:
Choose a difficulty.

T (1) = 1
T (n) = 2 T (n–1) + n , n ≥ 2
if n = 2 then
T (2) = 2 T (1) + 2
= 2 × 1 + 2 = 4
if n = 3 then T (3) = 2 T (2) + 3
= 2* 4 + 3 = 11
Put n = 3 in option (A)
24 – 3 – 2 = 16 – 3 – 2 = 11
so option (A) is true.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption D
Rate difficulty Rate difficulty:
Choose a difficulty.

The time complexity of computing the transitive closure of binary relation on a set of n elements is O (n3).
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption C
Rate difficulty Rate difficulty:
Choose a difficulty.
Found this useful?
Follow:

T(n) = 2T(n/2) + √n
Apply master’s method
nlog22 ⇒ n > √n
So T(n) = Θ(n)
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption C
Rate difficulty Rate difficulty:
Choose a difficulty.

T (n) = 2 T (n/2) + n
Apply masters method.
nlog22 ⇒ n ≅ n
So T (n) = O (nlogn)
Now growth rate of n2 and nlogn is greater than and equal to nlogn, thus (c) is false T (n) = Ω represent lower growth (n2)
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Why Practice with Avatto?
High Quality MCQsExam-focused questions with accurate answers
Detailed ExplanationsStep-by-step explanations to enhance learning
Latest Exam PatternBased on updated syllabus and pattern
Performance AnalyticsTrack performance and improve weak areas
100% Free PracticePractice unlimited questions for free
Boost Your PreparationAttempt mock tests, previous year papers and topic-wise quizzes.Explore All Tests →