Definition of the relevant properties on the full binary tree binary tree / complete binary tree and binary storage structure

First, the nature of binary tree

Properties of one: i-th layer in the binary tree has at most 2 '(i-1) th node

Two properties: a binary tree of depth k at most 2 (k th) -1 nodes

Three properties: an arbitrary binary tree T, which if the number of terminal nodes is N, the number of nodes of degree 2 is N2, then N = N2 + 1

Second, with full binary tree complete binary tree

K and has a depth of 2 to the power of k -1 nodes of a binary tree called a full binary tree
is popular, in addition to the binary tree is a leaf node, the other nodes are around children
Here Insert Picture Description
of depth k with n nodes of a binary tree , if and only if each of which nodes are associated with a full binary tree of depth k numbered 1 to n correspondence node, called a complete binary tree

Third, the binary tree storage structure

1. The structure of the memory sequence: according to the node to the next, stores the order from left to right
Here Insert Picture Description

2. Storage Structure

lchild  data  rchild

data

   ↙               ↘

lchild      rchild

Usually binary tree data structure chain domain, left child and right child
Here Insert Picture Description
trigeminal link is one more point to the root node pointer

Published 18 original articles · won praise 9 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_36834959/article/details/104254337
Recommended