What is not true about Insertion Sort?

  • A: stable
  • B: O(n log n)
  • C: on-line
  • D: in-place
  • E: good when input is almost sorted

    Answer: B

    Insertion Sort is O(n2), but is good when the input is almost sorted. It is also stable (does not change the relative position of equal keys), on-line (able to accept new items one at a time and process them efficiently), and in-place (does not need large extra storage).

    Contents    Page-10    Prev    Next    Page+10    Index