GATE CS 2003 · Insertion Sort

MCQ · 1 mark · Problem PROG-SORT-0057

The usual \(\Theta (n^{2})\) implementation of Insertion Sort to sort ab 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. A
    remain \(\Theta (n^{2})\)
  2. B
    become \(\Theta (n(logn)^{2})\)
  3. C
    become\(\Theta\)(nogn)
  4. D
    become\(\Theta\)(n)

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option A.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/912/gate2003-22

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com