Introduction HeapSort is a comparison-based sorting algorithm that uses the Heap Data Structure. Please refer to this link for more information about Heap –https://golangbyexample.com/heap-in-golang/ We demonstrate the heapsort in this article using…