![](https://i-blog.csdnimg.cn/blog_migrate/592b38567dee493d3925c82ef5dac98f.png)
二叉树深度和高度
In this tutorial, we will learn how to find height and depth of binary tree with program implementation in C++. It is one of the most commonly used non-linear data structures. We will learn about:
在本教程中,我们将学习如何使用C ++中的程序实现来查找二叉树的高度和深度。 它是最常用的非线性数据结构之一。 我们将了解:
- What is the height of a binary tree? 二叉树的高度是多少?
- Algorithm and implementation for finding height of Binary tree 查找二叉树高度的算法和实现
- What is the depth of a binary tree? 二叉树的深度是多少?
- Algorithm and implementation for finding depth of Binary tree 查找二叉树深度的算法和实现
Many times, people are confused between Depth and Height of Binary tree. It is because the depth of binary tree is always equal to the height of binary tree but they are not the same and using the terms interchangeably is not correct. So, it is important for us to understand the difference between the Height and Depth of Binary tree.
很多时候,人们对二叉树的深度和高度感到困惑。 这是因为二叉树的深度始终等于二叉树的高度,但是它们不相同,并且互换使用这些术语是不正确的。 因此,重要的是要了解二叉树的高度和深度之间的差异。
![Height and Depth of Binary Tree](https://i-blog.csdnimg.cn/blog_migrate/44cc4b91d2c6e1e45242cd07f11d1653.png)
二叉树的高度 (Height of Binary Tree)
“Dream as high as the s