Sorting Algorithms

Sorting Algorithms

C program of Bubble sort using linked list

C program of bubble sort using linked list : In my previous code of Bubble sort algorithm, we have seen how to write a C program of bubble sort using for loop. Today we will learn how to write c code of bubble sort using linked list. Bubble sort algorithm is a simple sorting algorithm that works by repeatedly stepping...

C program of Shell Sort Algorithm | C code champ

C program of Shell Sort Algorithm : Shell sort is one of the oldest sorting algorithms. Shell sort is a multi-pass algorithm which generalizes an exchanging sort, such as insertion or bubble sort, by starting the comparison and exchange of elements with elements that are far apart before finishing with neighboring elements. Starting with far apart elements can move...

C program for Radix Sort Algorithm

C program for Radix Sort Algorithm : Radix sort is a non-comparative integer sorting algorithm that sorts data with integer keys by grouping keys by the individual digits which share the same significant position and value.  Radix sort starts processing the keys from the most significant digit, leftmost digit, to the least significant digit, rightmost digit.  Radix sort stops...

C program for Pigeonhole Sort Algorithm | C code champ

C program for Pigeonhole sort algorithm : Pigeonhole sorting, also known as count sort (not to be confused with counting sort), is a sorting algorithm that is suitable for sorting lists of elements where the number of elements (n) and the number of possible key values (N) are approximately the same. The pigeonhole algorithm works as follows: Given an array of...

C program of Pancake Sort Algorithm | C code champ

C program of Pancake Sort Algorithm : Pancake sorting is a variation of the sorting problem in which the only allowed operation is to flip or swap the elements of some prefix of the sequence. Unlike a traditional sorting algorithm, which attempts to sort in fewest comparisons possible, the goal of  Pancake sorting algorithm also is to sort the...

C program for Insertion Sort Algorithm

C program for Insertion Sort Algorithm :  Insertion sort is an example of an incremental algorithm. It builds the sorted sequence or list one number at a time. This is perhaps the simplest example of the incremental insertion technique, where we build up a complicated structure on n items by first building it on n − 1 items and...