左平衡二叉树

编程入门 行业动态 更新时间:2024-10-09 22:19:17
本文介绍了左平衡二叉树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在读一本关于数据结构的书,它说左平衡的二叉树是一棵树,其中的叶子仅占据最后一层中的最左边的位置.

I am reading a book on data structures and it says that a left balanced binary tree is a tree in which the leaves only occupy the leftmost positions in the last level.

对我来说这似乎有点模糊.这是否意味着叶子仅在根的左侧并且分布在整个级别上,或者叶子仅在整个树的左侧存在.究竟什么构成左平衡?

This seemed a little vague to me. Does this mean that leaves are only on the left side of a root and are distributed throughout the whole level, or leave exists only on the left side of the entire tree. Exactly what constitute left balanced?

我不确定我的猜测是否涵盖了任何答案,因此,如果有人可以提供帮助,将不胜感激:-).

I am not sure if my guess even covers any of the answer, so if anyone could help, it would be greatly appreciated :-).

推荐答案

您可以将左平衡的二叉树视为平衡的二叉树,其中每个节点的左子树在右子树之前被填充.用更非正式的术语来说,这是一棵树,其中最底层的节点都在整个树的左侧.

You can think of a left-balanced binary tree as a balanced binary tree where the left sub-tree of each node is filled before the right sub-tree. In more informal terms, this is a tree wherein the nodes at the bottom-most level are all on the left side of the entire tree.

以这棵树为例:

这棵树是平衡的,但不是左平衡的.但是,如果删除节点67,则树将保持左平衡.

This tree is balanced, but not left-balanced. If node 67 were removed, however, the tree would be left-balanced.

更多推荐

左平衡二叉树

本文发布于:2023-11-30 07:40:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1649205.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:二叉树

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!