1.

Insertion sort is an example of an incremental algorithm.(a) True(b) FalseThe question was asked during an interview.My question is based upon Insertion sort in section Sorting of Data Structures & Algorithms II

Answer»

The correct answer is (a) True

Explanation: In the incremental algorithms, the complicated structure on n ITEMS is built by first BUILDING it on n − 1 items. And then we make the necessary changes to fix things in adding the last item. Insertion sort builds the sorted sequence one ELEMENT at a time. Therefore, it is an example of an incremental ALGORITHM.



Discussion

No Comment Found

Related InterviewSolutions