https://github.com/ivanbgd/heap-data-structure
The Heap data structure in Python, with the Heap Sort algorithm
https://github.com/ivanbgd/heap-data-structure
heap heap-sort heaps heapsort heapsort-algorithm
Last synced: about 2 months ago
JSON representation
The Heap data structure in Python, with the Heap Sort algorithm
- Host: GitHub
- URL: https://github.com/ivanbgd/heap-data-structure
- Owner: ivanbgd
- License: mit
- Created: 2017-11-12T17:03:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-12T17:22:37.000Z (over 7 years ago)
- Last Synced: 2025-02-03T10:11:57.570Z (3 months ago)
- Topics: heap, heap-sort, heaps, heapsort, heapsort-algorithm
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Heap-Data-Structure
The Heap data structure in Python, with the Heap Sort algorithmHeaps are Complete Binary Trees.
The Complete Binary Max-Heap is implemented as an array, which is both fast and memory efficient. It's also easy to code.
There are two variants of heaps here: the one that uses 1-based indexing, and the other that uses 0-based indexing, into arrays. 1-based indexing is faster than 0-based.
Partial sorting is also included in the code.
Priority Queues are usually implemented as Heaps.
The code includes examples.