Abstract
While the Collections framework provides a rich variety of real-world data structures, it unfortunately does not include trees for direct use. However, trees are helpful for various use cases and therefore desirable. Because the topic of trees is quite extensive, and not to go beyond the scope of this book, you will deal mainly with binary trees and binary search trees (BSTs) as special cases.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
The class TreeMap<K,V> is implemented using a so-called red-black tree.
- 2.
To be more precise, actually it’s used to represent the abstract syntax structure of the source code—not the source code itself.
- 3.
The computation gets a little bit easier if you assign the index 1 to the root. Then the children have positions 2i and 2i + 1.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature
About this chapter
Cite this chapter
Inden, M. (2022). Binary Trees. In: Java Challenges. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-7395-1_9
Download citation
DOI: https://doi.org/10.1007/978-1-4842-7395-1_9
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-7394-4
Online ISBN: 978-1-4842-7395-1
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)