Selection Sort

This type of sorting is called "Selection Sort" because it works by repeatedly element. It works as follows: first find the smallest in the array and exchange it with the element in the first position, then find the second smallest element and exchange it with the element in the second position, and continue in this … Read More

Bubble Sort

The bubble sort works by passing sequentially over a list, comparing each value to the one immediately after it. If the first value is greater than the second, their positions are switched. Over a number of passes, at most equal to the number of elements in the list, all of the values drift into their … Read More

Merge Sort

The mergesort algorithm is based on the classical divide-and-conquer paradigm. It operates as follows: DIVIDE: Partition the n-element sequence to be sorted into two subsequences of n/2 elements each. CONQUER: Sort the two subsequences recursively using the mergesort. COMBINE: Merge the two sorted sorted subsequences of size n/2 each to produce the sorted sequence consisting … Read More

Get notified with the latest posts

Plugin Supporter WordPress Post Navigation
%d bloggers like this: