From here, we will be explaining the Java data structure, is it ready? Let ' s go~~
The data structure model in Java can be divided into several parts:
1. Linear structure
2. Tree-shaped structure
3. Graphic or mesh structure
In the next few chapters, we will explain these data structures separately, mainly through the way of Java code.
Today's explanation is: Java linear structure
The tree structure of Java data structure
Before we learned about the linear structure of Java data structures in the first few chapters, we are going to learn the tree structure of Java from now on.
Tree for us to ordinary Java programmers, perhaps the usual time we seem to feel that it does not exist. But that's not true.
In fact, the JDK has been packaged for us, so give us an illusion that the tree data structure is very far away from us.
Give an example: TreeMap this set of framework, the bottom is the use of red and black trees ...
The following is a simple introduction to the data structure of the tree (if you want to know the details, please own Baidu Bar ~ Pro).
1. nodes in a tree can have several child nodes, but only one parent node per child node.
This is like a couple may have more than one child, but each child can have only one pair of parents.
2. classification of Trees
Tree of Java data Structures and two-fork tree