HeapSort implementation
✓ Published0🌍 Public
Aammarasmro
Last edited Nov 14, 2020
Created on Nov 14, 2020
HeapSort implementation demonstrates the classic heapsort algorithm sorting a randomly generated integer array. The code builds a max heap from an unsorted array of ten random integers, then repeatedly extracts the maximum element to produce a sorted sequence. The visualization uses Java's `SimpleWriter` and `SimpleWriter1L` APIs from the components library to output both the initial unsorted values and the final sorted result to the console. The program generates its data source internally using `Math.random()` to create pseudorandom integers between 0 and 199, then prints each stage of the process, showing the array before and after sorting.
AI-generated description