Category: sorting c

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

Selection sort in java

Selection Sort in C

Selection Sort: Selection sort is easy and well known sorting technique.In selection sort unordered list is divided into two parts sorted and unsorted. minimum number from unsorted list is selected and placed in at...

Quick Sort in java

quick sort program in c

Quicksort: In quick sort one element is selected as a pivot from array.Using pivot array is divided into two parts elements less than pivot and greater than pivot. procedure is done until array get...

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 unsorted array and placed at proper location in sorted array. Worst case performance:     О(n2)...