chapter_tree/binary_tree/ #153
Replies: 34 comments 50 replies
-
/* 插入与删除结点 */ |
Beta Was this translation helpful? Give feedback.
-
”二叉树中的插入与删除一般都是由一套操作配合完成的“,这里的”一套操作“指什么呢?可以理解为资源的子节点的资源释放吗? |
Beta Was this translation helpful? Give feedback.
-
我对高度的定义有点疑问,如果高度的定义是走过边的数量,那么只有根节点的二叉树,高度是否就是0,完美二叉树总结点数量=2^0-1=0 |
Beta Was this translation helpful? Give feedback.
-
那么有一个结点的二叉树,高度和深度都是0,对吗 |
Beta Was this translation helpful? Give feedback.
-
7.1.3 tips: |
Beta Was this translation helpful? Give feedback.
-
请问一下画图是用的什么工具啊, 很好看! |
Beta Was this translation helpful? Give feedback.
-
类比楼的高度,和水的深度,从下往上看和从上往下看 |
Beta Was this translation helpful? Give feedback.
-
感觉二叉树的内容有点少,案例缺失,能补充点实际场景吗? |
Beta Was this translation helpful? Give feedback.
-
在完美二叉树的定义中,这里写的是(除了最底层外,其余所有层的节点都被完全填满) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
完美二叉树中,说了“若树高度为h,则节点总数为2^(h+1)”,这里不应该用“高度”,而应该用“深度”吧?包括后面的陈述都是用的“高度”这个词。 |
Beta Was this translation helpful? Give feedback.
-
作者你好,根据文章里“7.1.1二叉树常见术语”中的定义,以及使用“边”来衡量“高度”与“深度”,有一个疑惑:叶子节点的“高度”是 0 吗?类似的,只有一个根节点的二叉树,该树的“高度”是 0 吗? 我问的这个问题,直接关系到我对于“图7-7平衡二叉树”里的“变量 d ”的计算的理解,因为这个地方我没看懂,我自己根据上文的定义来计算每个节点的 d 的值,发现跟文中对不上~~ |
Beta Was this translation helpful? Give feedback.
-
节点的「高度 height」:从最远叶节点到该节点所经过的边的数量。 |
Beta Was this translation helpful? Give feedback.
-
我大学教材和百度的大部分答案说, 树的高度是从根节点到最远节点的节点个数而不是边的个数,因此树的高度 = 树的深度 = 树中节点的最大高度 + 1 ,!= 节点的最大高度。本文定义是否有误?最后的表格中,是否“高度为 h 的树的节点总数”应为“ 2 ^ h - 1” ? 不知道是不是有多种定义, 供作者参考喵 |
Beta Was this translation helpful? Give feedback.
-
才知道原来汉语里面parent node是父节点...😅 |
Beta Was this translation helpful? Give feedback.
-
大神,二叉树插入代码,这样写更好点吧 |
Beta Was this translation helpful? Give feedback.
-
你好,作者,如果能把每章评论里的问题集做到每章的结尾,这样Hello算法就更完善了。 |
Beta Was this translation helpful? Give feedback.
-
貌似 除了根节点的其他节点都叫叶节点,而度为 0 的节点应该叫叶子节点? |
Beta Was this translation helpful? Give feedback.
-
二叉树的「高度 height」:从根节点到最远叶节点所经过的边的数量。 |
Beta Was this translation helpful? Give feedback.
-
很高兴可以发现这个宝藏网站。
具体是什么样的结构?尽量靠左填充是如何操作的?怎样才算不尽量?如何的不尽量靠左填充会让这个结构不是一个完全二叉树? 最后,很高兴可以有这样一个评论区,可以在啃书的时候提出疑问。 |
Beta Was this translation helpful? Give feedback.
-
k神这个可以添加导出为PDF的功能吗,我想把某个章节喂到ChatGPT进行对话式学习。 |
Beta Was this translation helpful? Give feedback.
-
我把二叉树当成倒着的树来看是不是就可以了TAT |
Beta Was this translation helpful? Give feedback.
-
请问在二叉树常用术语中最远叶节点是指什么含义呢?有严格的定义吗? |
Beta Was this translation helpful? Give feedback.
-
请问插入一个节点的时候,不用比较相邻节点的大小吗? |
Beta Was this translation helpful? Give feedback.
-
K神,判断节点高度中,"从距离该节点最远的叶节点到该节点所经过的边的数量",其中的叶节点是默认对应子树下的情况吗? |
Beta Was this translation helpful? Give feedback.
-
谢谢,您的邮件我已收到。
|
Beta Was this translation helpful? Give feedback.
-
你的邮件我已经收到!
|
Beta Was this translation helpful? Give feedback.
-
你的邮件我已经收到!
|
Beta Was this translation helpful? Give feedback.
-
把节点度数改成出度和入度比较好,出度和入度之和为该节点的度数,二叉树就是一个根节点入度为0,叶节点出度为0的无回路连通图。这样还可以利用握手定理,进一步推出二叉树的边数=节点数-1 |
Beta Was this translation helpful? Give feedback.
-
学海8舍潘红臣实名打卡 |
Beta Was this translation helpful? Give feedback.
-
chapter_tree/binary_tree/
一本动画图解、能运行、可提问的数据结构与算法入门书
https://www.hello-algo.com/chapter_tree/binary_tree/
Beta Was this translation helpful? Give feedback.
All reactions