Tuesday, February 21, 2012

2. QUICK SORT IN C

Quicksort is a sorting algorithm developed by Tony Hoare that, on average, comparisons to sort n number of items Various types of sorting techniques are available in c, Quick Sort is quite popular.

1. BUBBLE SORT PROGRAM IN C

Bubble sort, also known as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted. The algorithm gets its name from the way smaller elements "bubble" to the top of the list. Because it only uses comparisons to operate on elements, it is a comparison sort. Although the algorithm is simple, it is not efficient for sorting large lists.