Category: sorting java

Merge sort in java

Merge Sort program in Java

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 program in Java

Bubble sort: It is one of the simplest sorting algorithm.In bubble sort each and every element is compared with its adjacent element and swap if at wrong place diagram below shows the working of...

Insertion sort in java

Insertion Sort program in Java

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

Heap sort in java

Heap Sort program in Java

Heap Sort: Heap sort is a comparison based sorting technique based on Binary Heap data structure. It is similar to selection sort where we first find the maximum element and place the maximum element...