Skip to content

Commit 2358ee6

Browse files
committed
add tree leetcode
1 parent 215f31a commit 2358ee6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/14_树与二叉树/tree.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,14 @@ class Queue(object): # 借助内置的 deque 我们可以迅速实现一个 Que
264264
- 树的遍历我们用了 print,请你尝试换成一个 callback,这样就能自定义处理树节点的方式了。
265265
- 请问树的遍历操作时间复杂度是多少?假设它的 size 是 n
266266
- 你能用非递归的方式来实现树的遍历吗?我们知道计算机内部使用了 stack,如果我们自己模拟如何实现?请你尝试完成
267-
- 使用树的层序遍历我们能实现一个树的左右视图,比如从一个二叉树的左边能看到哪些节点。请你尝试做这个练习题 https://leetcode.com/problems/binary-tree-right-side-view/description/
268267

269268

270269
# 延伸阅读
271270
- 《Data Structures and Algorithms in Python》 13 章 Binary Trees
272271
- [https://www.geeksforgeeks.org/iterative-preorder-traversal/](https://www.geeksforgeeks.org/iterative-preorder-traversal/)
272+
273+
274+
# Leetcode
275+
276+
使用树的层序遍历我们能实现一个树的左右视图,比如从一个二叉树的左边能看到哪些节点。
277+
请你尝试做这个练习题 https://leetcode.com/problems/binary-tree-right-side-view/description/

0 commit comments

Comments
 (0)