Sinkron : Jurnal dan Penelitian Teknik Informatika
Vol. 10 No. 3 (2026): Article Research July 2026

A Comprehensive Analysis of Heap Sort Algorithm for Efficient Sorting Using C++ Programming Language

Rakhmat Purnomo (Department of Informatics, Faculty of Computer Science, Universitas Bhayangkara Jakarta Raya)
Tri Dharma Putra (Department of Informatics, Faculty of Computer Science, Universitas Bhayangkara Jakarta Raya)



Article Info

Publish Date
07 Jul 2026

Abstract

Sorting is a need in the computational system including in big data analysis, database management systems, and real time applications. Heap sort is an efficient, comparison-based sorting algorithm that visualizes an array as a binary tree and transforms it into a heap data structure (usually a max heap for ascending sort). The algorithm repeatedly takes the largest element from the root of the heap, swaps it with the last element, and thus reduces the heap size until the heap is sorted The algorithm repeatedly takes the largest element from the root of the heap, swaps it with the last element, and thus reduces the heap size until the heap is sorted. The steps of this algorithm: a. Create Max Heap: Convert the input array into a Max Heap. b. Sort: Swap the root element (the largest element) with the last element, decrease the heap size by 1, and then convert the new root element into a heap. c. Repeat step 2 until the heap is empty. C++ is a known programming language. In this journal we use C++ programming to sort unsorted array. The code is presented in the details. One thorough step by step simulation is given in real data with heap sort and the program is run. The analysis is given by 7 data, namely:  [13, 10, 30, 2, 6, 7, 9]. The result is a presented with sorted heap sort. With 7 datasets to be analysed, it is concluded that 6 swaps happened.

Copyrights © 2026






Journal Info

Abbrev

sinkron

Publisher

Subject

Computer Science & IT

Description

Scope of SinkrOns Scientific Discussion 1. Machine Learning 2. Cryptography 3. Steganography 4. Digital Image Processing 5. Networking 6. Security 7. Algorithm and Programming 8. Computer Vision 9. Troubleshooting 10. Internet and E-Commerce 11. Artificial Intelligence 12. Data Mining 13. Artificial ...