Heap Sort
Heap Sort Algorithm In this tutorial, you will learn how heap sort algorithm works. Also, you will find working examples of heap sort in C, C++, Java and Python. Heap Sort is a popular and efficient sorting algorithm in computer programming. Learning how to write the heap sort algorithm requires knowledge of two types of data structures - arrays and trees. The initial set of numbers that we want to sort is stored in an array e.g. [10, 3, 76, 34, 23, 32] and after sorting, we get a sorted array [3,10,23,32,34,76] Heap sort works by visualizing the elements of the array as a special kind of complete binary tree called a heap. As a prerequisite, you must know about a complete binary tree and heap data structure . Relationship between Array Indexes and Tree Elements A complete binary tree has an interesting property that we can use to find the children and parents of any node. If the index of any element in the array is i , the element in the...