Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE-CS-2003 | Question 22

  • Last Updated : 28 Jun, 2021

The usual Θ(n2) implementation of Insertion Sort to sort an array uses linear search to identify the position where an element is to be inserted into the already sorted part of the array. If, instead, we use binary search to identify the position, the worst case running time will

1)
2)
3)
become Θ(n log n)
4) become Θ(n)
(A) remain Θ(n2)
(B) become Θ(n (log n)2)
(C) become Θ(n log n)
(D) become Θ(n)


Answer: (A)

Explanation: See Question 1 of https://www.geeksforgeeks.org/data-structures-and-algorithms-set-6/

Also see Binary Insertion Sort


Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :