sorting algorithms

Sorting Algorithms

In computer science, a sorting algorithms is an algorithm that puts elements of a list in a certain order.Different sorting algorithms. There are many different techniques available for sorting, differentiated by their efficiency and space requirements.

A Sorting Algorithm is used to rearrange a given array or list elements according to a comparison operator on the elements by any order. The comparison operator is used to decide the new order of element.

1] Bubble sort - Click link for Full Tutorial.

Bubble sort is a simple sorting algorithm. This sorting algorithm is comparison-based algorithm in which each pair of next elements is compared and the elements are swapped if they are not in order.

2] Selection sort - Click link for Full Tutorial.

Selection sort is a simple sorting algorithm. This sorting algorithm is in which the list is divided into two parts, the sorted part at the left end and the unsorted part at the right end. Initially, the sorted part is empty and the unsorted part is the entire list.

3] Merge sort Click link for Full Tutorial.

Merge sort is a sorting technique based on divide and conquer technique. With worst-case time complexity being Ο(n log n), it is one of the most respected algorithms.

4] Insertion sort Click link for Full Tutorial.

This is an in-place comparison-based sorting algorithm. Here, a sub-list is maintained which is always sorted. For example, the lower part of an array is maintained to be sorted. An element which is to be 'insert'ed in this sorted sub-list, has to find its appropriate place and then it has to be inserted there. Hence the name, insertion sort.

5] Quick sort Click link for Full Tutorial.

Quick sort is a highly efficient sorting algorithm and is based on partitioning of array of data into smaller arrays. A large array is partitioned into two arrays one of which holds values smaller than the specified value, say pivot, based on which the partition is made and another array holds values greater than the pivot value.

6] Heap sort  Click link for Full Tutorial.

This is an in-place comparison-based sorting algorithm. Here, a sub-list is maintained which is always sorted.

7] Radix sort Click link for Full Tutorial.

This sorting algorithm is an in-place comparison-based algorithm in which the list is divided into two parts.

8] Shell sort Click link for Full Tutorial.

Shell sort is a highly efficient sorting algorithm  This algorithm avoids large shifts as in case of insertion sort, if the smaller value is to the far right and has to be moved to the far left.

Thanks!

Comments