Professional KnowledgeHardIBPS SO IT
Time complexity of finding the k-th smallest element in an unsorted array in the worst case using median-of-medians is:
- A. O(n log n)
- B. O(k log n)
- C. O(n^2)
- D. O(n)
Correct answer: D. O(n)
Median of medians guarantees linear-time worst-case selection.
Practise more IT Officer Professional Knowledge (IBPS SO) questionsIT Officer Professional Knowledge (IBPS SO): notes and key points
More IT Officer Professional Knowledge (IBPS SO) questions
- Recurrence T(n) = 3T(n/2) + n solves to:
- Which sorting algorithm has O(n log n) worst case and is not stable?
- Which algorithm design technique does Dijkstra's single-source shortest path use?
- Floyd-Warshall algorithm complexity for V vertices is:
- In a connected weighted graph with distinct edge weights, the minimum spanning tree is:
- Which data structure does BFS use and which does DFS use (iterative)?