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 A
Rate difficulty Rate difficulty:
Choose a difficulty.

Since f(n) = log n
a = 2, b = 2
finding logba using master’s method = log22 = 1
Hence, f(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 A
Rate difficulty Rate difficulty:
Choose a difficulty.

The time complexity is O (m + logn)
So C = 1, d = 0, a = 0, b = 1
0 + 10 × 1 + 100 × 1 + 1000 × 0 = [110]
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.
Found this useful?
Follow:

* Outer loop (for i) executed n times.
* Loop (for j) executed logn times so value of p = logn.
loop (for k) executed log p times.
So value of q = log p = log logn.
for every value of i loop (k) is executed so return value is n * log logn
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.

Unsorted array
The algorithm perform
find operation (log N)½
Insert operation N
delete operation (log N)½
decrease key operations (log N)½
Hence unsorted array is best data structure for all above operations.
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.

The subtrees are already Max-heap, so to make it half, we have to heap if the root, which takes Ω(log n) time.
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 →