1.

Insertion sort is an online sorting algorithm.(a) true(b) falseThe question was posed to me at a job interview.I want to ask this question from Sorting in portion Sorting of Data Structures & Algorithms II

Answer»

The correct option is (a) true

Easiest explanation - Insertion sort does not require the entire INPUT DATA in the beginning itself in ORDER to sort the array. It rather creates a partial solution in every step, so future elements are not required to be CONSIDERED. HENCE it is an online sorting algorithm.



Discussion

No Comment Found

Related InterviewSolutions