© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
R. WienerGeneric Data Structures and Algorithms in Gohttps://doi.org/10.1007/978-1-4842-8191-8_11

11. Heap Trees

Richard Wiener1  
(1)
Colorado Springs, CO, USA
 

The previous chapter presented AVL trees. These trees are extremely useful when many fast lookups are needed.

In this chapter, we present another important tree structure, Heap. A heap tree is another balanced tree type with the largest item in the tree always in the root of the tree. We use a heap tree to implement an efficient sorting algorithm.

In the next section, we define heap tree and illustrate heap tree construction.

11.1 Heap Tree Construction

A heap is a complete binary tree such that each node ...

Get Generic Data Structures and Algorithms in Go: An Applied Approach Using Concurrency, Genericity and Heuristics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.