以下是比较常见的题型 1、二叉树的深度/宽度 二叉树的最大深度 "104 Maximum Depth of Binary Tree" 二叉树的最小深度 "111 Minimum Depth of Binary Tree" 二叉树的最大宽度 "662 Maximum Width of Binary T ...
分类:
其他好文 时间:
2018-03-11 14:32:08
阅读次数:
254
一般常见于二叉树的层序遍历 "Binary Tree Level Order Traversal" "Binary Tree Level Order Traversal II" "Binary Tree Zigzag Level Order Traversal" ...
分类:
其他好文 时间:
2018-03-11 14:29:33
阅读次数:
131
[抄题]: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given ...
分类:
其他好文 时间:
2018-03-11 14:15:02
阅读次数:
124
二叉搜索树(题型总结) 以下是比较常见的题型,加粗的便是比较常考的了 BST基本操作 验证BST "098 Validate Binary Search Tree" 将排序数组转化为BST "108 Convert Sorted Array to Binary Search Tree" 将排序链表转 ...
分类:
其他好文 时间:
2018-03-11 14:13:24
阅读次数:
146
[抄题]: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is ...
分类:
其他好文 时间:
2018-03-11 11:52:52
阅读次数:
159
[抄题]: Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ...
分类:
其他好文 时间:
2018-03-11 11:52:17
阅读次数:
110
来源:codeforces D. Timetable Ivan is a student at Berland State University (BSU). There are n days in Berland week, and each of these days Ivan might ha ...
分类:
其他好文 时间:
2018-03-10 17:51:03
阅读次数:
259
原题链接: "https://leetcode.com/problems/maximum depth of binary tree/description/" 这道题目级别为“Easy”,也确实是简单! 不废话,直接使用递归实现深度优先搜索即可: ...
分类:
其他好文 时间:
2018-03-10 14:07:02
阅读次数:
130
原题链接: "https://leetcode.com/problems/binary tree level order traversal ii/description/" 这道题目是 "http://www.cnblogs.com/optor/p/8538693.html" 这一道的后续,也是很 ...
分类:
其他好文 时间:
2018-03-10 14:05:54
阅读次数:
165
原题链接: "https://leetcode.com/problems/binary tree level order traversal/description/" 这道题目级别为“Easy”,解答出来也确实容易!直接使用个队列进行递归即可: ...
分类:
其他好文 时间:
2018-03-10 14:02:39
阅读次数:
171