Category: sorting c

Insertion sort in java

Insertion Sort program in C

Insertion Sort: Insertion sort is somewhat similar to selection but in insertion sort, one element is selected from an unsorted array and placed at a proper location in a sorted array. Worst case performance:...

Heap sort in java

Heap Sort Program in c

Heap Sort: #include <stdio.h> #include <conio.h> void makeheap ( int [ ], int ) ; void heapsort ( int [ ], int ) ; void main( ) { int arr[10] = { 11, 2,...

Merge sort in java

Merge Sort Program in c

Merge Sort: Merge sort is based on the divide and conquer technique. In merge sort unsorted array is divided in half again and again ,until each array contain 1 element. Divided list are merged...

Bubble sort in java

Bubble Sort in C

Bubble Sort: #include <stdio.h> #include <conio.h> void main( ) { int arr[5] = { 25, 17, 31, 13, 2 } ; int i, j, temp ; clrscr( ) ; printf ( “Bubble sort.\n” )...