Heap Sort in C++

The Heapsort algorithm uses Heap data structure to sort an array in O(nlogn) time complexity. It starts by calling Build-Max-Heap.

Common Sorting Algorithms

A sorting algorithm is an algorithm that puts elements of a list into an order. Most frequently we’re required to sort data structures such as arrays, linked lists etc having numerical values. There’re various algorithms to sort a container or a data structure. In this post, we’ll discuss most popular or […]

Which sorting algorithm makes minimum number of swaps?

Sorting means arranging a set of data in an order. There’re various algorithms to sort the data (in a data structure) in increasing or decreasing order. These algorithms can be divided on basis of various factors: Inplace sorting means that all the data which is to be sorted can be accommodated […]

Quicksort worst-case and averages-case analysis

Quicksort algorithm was developed by a British computer scientist Tony Hoare in 1959.  “Quick Sort” is capable of sorting a list of data elements significantly faster (twice or thrice faster) than any of the common sorting algorithms and that’s why it is the favourite topic of interviewers in programming interviews. It is one […]