码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
leetcode [95]Unique Binary Search Trees II
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
Lintcode177-Convert Sorted Array to Binary Search Tree With Minimal Height-Easy
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
LeetCode-101.Symmetric Tree
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
110.Balanced Binary Tree
``` 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
111.Minimum Depth of Binary Tree
``` 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 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
Lintcode155-Minimum Depth of Binary Tree-Easy
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
637. Average of Levels in Binary Tree(一棵树每层节点的平均数)(二叉树的层序遍历)
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
94. Binary Tree Inorder Traversal(非递归实现二叉树的中序遍历)
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
03-树3 Tree Traversals Again (25 分)
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!