Question DSA-ARR-0017
HardWhat is the best time complexity for finding the k-th smallest element in an unsorted array, on average?
- A.
O(n²)
- B.
O(n) with Quickselect
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Arrays question
What is the best time complexity for finding the k-th smallest element in an unsorted array, on average?
O(n²)
O(n) with Quickselect
Sign up free to see the answer and a step-by-step explanation.
O(log n)
O(n log n) with sorting only