Category Archives: Sorting Algorithm

We will discuss the famous sorting techniques.

Bubble Sort algorithm
Insertion sort algorithm
Selection sort algorithm
Quick sort algorithm
Merge sort algorithm

Sort an integer array using mergesort algorithm in java (with example)

What is merge sort algorithm? Merge sort(or MergeSort) is efficient, comparison based algorithm. The properties of merge sort algorithm are as follows: MergeSort is divide and conquer algorithm. MergeSort is a stable algorithm, the relative order of equal keys does not changed during sorting. MergeSort requires additional O(n) space, so its not recommended for large… Read More »

Sort integer array in java using quicksort algorithm (example)

Given unsorted integer array in java. We would like to sort integer array using quick sort algorithm in java. 1. What is quicksort algorithm in java? Quicksort (or partition-exchange sort) is commonly used and efficient sorting algorithm. The properties of quicksort algorithms are: Quicksort is divide and conquer algorithm. Quicksort is not stable algorithm, the… Read More »

Sort an integer array using insertion sort algorithm in java (with example)

What is insertion sort algorithm? Insertion sort is a sorting technique. The elements are inserted at an appropriate place in an array, so that array remains the sorted. The insertion sort is quite simple algorithm. The time complexity of insertion sort algorithm is O(n^2). The logical flow of insertion sort is as follows Given an unsorted array… Read More »

Sort an integer array using selection sort algorithm in java (with example)

What is selection sort algorithm? Selection sort is sorting technique used to sort the elements in list data structure like array. The selection sort is quite simple algorithm. The time complexity of selection sort algorithm is O(n^2). The logical flow of selection sort is as follows Given an unsorted integer array. Array will be virtually divided into… Read More »