Tri Dharma Putra
Department of Informatics, Faculty of Computer Science, Universitas Bhayangkara Jakarta Raya

Published : 1 Documents Claim Missing Document
Claim Missing Document
Check
Articles

Found 1 Documents
Search

A Comprehensive Analysis of Heap Sort Algorithm for Efficient Sorting Using C++ Programming Language Rakhmat Purnomo; Tri Dharma Putra
Sinkron : jurnal dan penelitian teknik informatika Vol. 10 No. 3 (2026): Article Research July 2026
Publisher : Politeknik Ganesha Medan

Show Abstract | Download Original | Original Source | Check in Google Scholar | DOI: 10.33395/sinkron.v10i3.16185

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.