Binary Tree
来源:互联网 发布:iapp制作文字游戏源码 编辑:程序博客网 时间:2024/06/16 15:40
A Binary tree is made up of a set of elements called nodes. This set either is empty or consists of a node called the root together with to binary trees, called the left and right subtrees, which are disjoint from each other and from the root. The roots of these subtrees are children of the root. There is an edge from a node to each of its children, and a node is said to be the parent of its children.
The depth of a node M in the tree is the length of the path from root of the tree to node M. The height of a tree is one more than the depth of the deepest node in the tree. All nodes of depth d are at level d in the tree. The root is the only node at level 0, and its depth is 0. A leaf node is any node that has two empty children. Aninternal node is any node that has at one non-empty child.
Full Binary Tree:
Each node in a full binary tree is either an internal node with exactly two non-empty children or a leaf.
Complete Binary Tree:
A complete binary tree has a restricted shape obtained by starting at the root and filling the tree by levels from left to right.
If a tree is a full binary tree, the number of nodes in this tree is even, and the number of leaf nodes is one more than that of internal nodes.
Any process for visiting all of the nodes in some order is called a traversal(遍历).
Binary Search Tree
All nodes stored in the right subtree of a node whose key value is K have key values greater than or equal to K.
All nodes stored in the left subtree of a node whose key value is K have key values less than K.
- Binary tree
- Binary Tree
- Binary Tree
- Binary Tree
- Binary Tree
- Binary Tree
- Binary Tree
- binary tree
- Binary Tree
- Binary Tree
- Binary Tree
- Binary Tree
- Binary Tree
- Binary Tree
- Binary Tree
- Binary Tree
- Binary Tree
- binary tree
- 小记-面试时对MVC的理解
- vue简介
- python3.6基础学习记录(二)
- 线段树基础
- 小白入门,获取Json串
- Binary Tree
- python_lintcode_480二叉树的所有路径_376二叉树的路径和
- iOS网络-AFNetworking详解
- 【C语言·字符串】常用字符串函数介绍
- SQL中的case when then else end用法
- over 函数 和 leteral view
- 代码设置textsize(不用diptopx,pxtodip啦)
- hdu 2795 Billboard
- 移除两个数组中相同的值