Question:

Published on: 23 January, 2022

How insertion sort and selection sorts are different?

Answer:

Both sorting techniques maintains two sub-lists, sorted and unsorted and both take one element at a time and places it into sorted sub-list.

Insertion sort works on the current element in hand and places it in the sorted array at appropriate location maintaining the properties of insertion sort. Whereas, selection sort searches the minimum from the unsorted sub-list and replaces it with the current element in hand.

Subjects

Trending

Write a C language function to find the in-order successor of the root of a binary tree.

View : 31

21 January, 2022

Random questions

What is tree traversal?

23 January, 2022

Write the recursive algorithm to find x^ n.

27 May, 2022

Write short notes: B tree

27 May, 2022