Q. Explain how each of these algorithms works
a. insertion sort
b. bubble sort
Answers
Answered by
1
Explanation:
Insertion sort is a simple sorting algorithm that works similar to the way you sort playing cards in your hands. The array is virtually split into a sorted and an unsorted part. Values from the unsorted part are picked and placed at the correct position in the sorted part.
A bubble sort algorithm goes through a list of data a number of times, comparing two items that are side by side to see which is out of order. It will keep going through the list of data until all the data is sorted into order.
Similar questions
Political Science,
15 hours ago
English,
15 hours ago
English,
15 hours ago
India Languages,
1 day ago
Math,
8 months ago