Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1 ... n. Example: 题目大意: 给定1到n这n个数字,返回集合,集合中存放所有可能二叉 ...
分类:
其他好文 时间:
2019-04-10 18:00:33
阅读次数:
118
177. Convert Sorted Array to Binary Search Tree With Minimal Height Given a sorted (increasing order) array, Convert it to create a binary tree with m ...
分类:
其他好文 时间:
2019-04-10 13:35:57
阅读次数:
112
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 symmet ...
分类:
其他好文 时间:
2019-04-09 20:27:21
阅读次数:
175
```
class Solution {
public: bool isBalanced(TreeNode *root) { if (checkDepth(root) == -1) return false; else return true; } int checkDepth(TreeNode *... ...
分类:
其他好文 时间:
2019-04-09 15:14:23
阅读次数:
140
``` class Solution { public: int minDepth(TreeNode* root) { if (!root) return 0; if (!root->left) return 1 + minDepth(root->right); if (!root->right) ... ...
分类:
其他好文 时间:
2019-04-09 15:09:48
阅读次数:
154
从库报这个错误:Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file' Got fatal er ...
分类:
其他好文 时间:
2019-04-09 13:56:52
阅读次数:
210
155. Minimum Depth of Binary Tree Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from t ...
分类:
其他好文 时间:
2019-04-09 12:36:45
阅读次数:
139
Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Note: 这个题主要想总结一下bfs算法: 广度优先遍历:类 ...
分类:
其他好文 时间:
2019-04-09 00:47:41
阅读次数:
145
Given a binary tree, return the inorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it iteratively ...
分类:
其他好文 时间:
2019-04-08 15:44:17
阅读次数:
113
An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the ...
分类:
其他好文 时间:
2019-04-08 13:41:11
阅读次数:
116