Week 3 Discussion Forum

What is the Difference Between Insertion Sort and Selection Sort

What is the Difference Between Insertion Sort and Selection Sort

by hafiz 191-15-2343 -
Number of replies: 2

The main difference between insertion sort and selection sort is that insertion sort performs sorting by exchanging an element at a time with the partially sorted array while selection sort performs sorting by selecting the smallest element from the remaining elements and exchanging it with the element in the correct location.

51 words

In reply to hafiz 191-15-2343

Re: What is the Difference Between Insertion Sort and Selection Sort

by MD.Munim Shariair Galib -

Linear Search:   In computer science, a linear search or sequential search is a method for finding an element within a list. It sequentially checks each element of the list until a match is found or the whole list has been searched.

Insertion Sort:   Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, merge sort.



80 words

In reply to hafiz 191-15-2343

Re: What is the Difference Between Insertion Sort and Selection Sort

by Ahsan Habib Nobel -
We have learned about linear search, Brute Force techniques and different types of sorting.

Linear search, which is a sequential search, though it’s a slow process but it gives us absolute or optimized result. It has three cases, best, worst and average.

Then we came to know about Insertion Sort and the complexity of it. At last we learned the pseudocode of insertion sort. So, this was all about this week’s lesson.

72 words