Data Structures

Data Structures

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...

C program of Heap Sort Algorithm | C code champ

C program of Heap Sort Algorithm : Heapsort is a comparison based sorting algorithm to create a sorted array (or list), and is part of the selection sort family. Heap sort is actually a two step algorithm. The first step is to build a heap out of the data. The second step begins with removing the largest element from the heap....

C program of Gnome Sort Algorithm | C code champ

C program of Gnome Sort Algorithm : Gnome sort is a sorting algorithm which is similar to Insertion sort, except that moving an element to its proper place in Gnome sort is done by a series of swaps, as in Bubble Sort. It is very simple algorithm, requiring no nested loops. The Gnome Sort algorithm always finds the first...

C program for Counting Sort Algorithm

C program for Counting Sort Algorithm :  Counting sort is an algorithm for sorting a collection of objects according to keys that are small integers i.e. it is an integer sorting algorithm. It operates by counting the number of objects that have each distinct key value, and using arithmetic on those counts to determine the positions of each key...

C program for Comb Sort Algorithm | C code champ

C program for Comb Sort Algorithm : Combo sort is an sorting algorithm. It is an efficient variation of bubble sort that eliminates "turtles", the small values near the end of the list and makes use of gaps between values. How the Combo sort algorithm works : In comb sort, using Gaps properly is the main part . For example, in...

C program for Cocktail Sort algorithm | C code champ

C program for Cocktail Sort Algorithm : Cocktail sort is also known as bidirectional bubble sort, cocktail shaker sort, shaker sort (which can also refer to a variant of selection sort), ripple sort, shuffle sort, shuttle sort or happy hour sort, is a variation of bubble sort that is both a stable sorting algorithm and a comparison sort. The...