The document describes a MinHeap class implemented in Python, which allows for the insertion of values while maintaining the heap property. It includes methods for inserting values and restoring the heap structure through a heapify-up process. A test case demonstrates the functionality by inserting a set of values and printing the resulting min heap as an array.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
5 views1 page
Array Based Min Heap
The document describes a MinHeap class implemented in Python, which allows for the insertion of values while maintaining the heap property. It includes methods for inserting values and restoring the heap structure through a heapify-up process. A test case demonstrates the functionality by inserting a set of values and printing the resulting min heap as an array.