1.

What is the worst case time complexity of library sort?(a) O(n)(b) O(n log n)(c) O(n^2)(d) O(log n)This question was addressed to me in an international level competition.This intriguing question comes from Sorting in division Sorting of Data Structures & Algorithms II

Answer»

The correct OPTION is (c) O(n^2)

Easiest EXPLANATION - The worst case TIME complexity of library sort is the same as that of INSERTION sort. The worst case time complexity is O(n^2).



Discussion

No Comment Found

Related InterviewSolutions