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

The recurrence equation is
T(n) = T(n – 1) + T(1) + cn
In quick sort, worst case divide the list into two list with 1 and (n – 1) elements each 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 *

Correct AnswerOption A
Rate difficulty Rate difficulty:
Choose a difficulty.
Share this question
Share:

When we put (a, left–End, K) and (a+ left – end + 1, n– left – end –1, k– left–end –1)at the place of fill in the blank algorithm work for partition.
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.

Complexity is remain same because we had swap after finding to position of element so in worst case swapping for each element requires Q (n) time hence complexity is O (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 *

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

If we take example, 40, 30, 10, 12, 85, 48, 9, 16
Next step : 30, 40, 10, 12, 35, 48, 9, 16
Next step : 10, 12, 30, 40, 9, 16, 35, 48
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.

If array of size n with n inversion then complexity of insertion sort is Q (n)
Let us take an example.
(6 1 2 3 5 6 4)
total no. of comparision require to sort above array is 2 (n–1) = 2* 5 = 10
so complexity is Q (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 *

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 →