码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST./** * Definition for binary tree * public class TreeN...
分类:其他好文   时间:2015-04-12 20:38:48    阅读次数:159
[leetcode]Binary Tree Right Side View
好久不写了,最近忙毕业论文呢。这个题,就是说一个二叉树,你从右边看,你能看到的数有哪些(会被遮挡)其实抽象出来就是说。。。二叉树每层最右边的数有哪些。。那我们按层遍历一次就好了。/** * Definition for binary tree * struct TreeNode { * in...
分类:其他好文   时间:2015-04-12 20:37:02    阅读次数:110
PAT006 Tree Traversals Again
题目: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 ...
分类:其他好文   时间:2015-04-12 16:06:42    阅读次数:107
LeetCode 105/106 Construct Binary Tree from Preorder/Postorder and Inorder Traversal
一:LeetCode 105 Construct Binary Tree from Preorder and Inorder Traversal 题目: Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates d...
分类:其他好文   时间:2015-04-12 14:50:20    阅读次数:117
Binary Search Tree Iterator
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next...
分类:其他好文   时间:2015-04-12 14:38:25    阅读次数:134
[LeetCode 85] Maximal Rectangle (华为2015机试)
题目链接:maximal-rectangle import java.util.Arrays; /** * Given a 2D binary matrix filled with 0's and 1's, * find the largest rectangle containing all ones and return its area. * */ public cl...
分类:其他好文   时间:2015-04-12 13:28:40    阅读次数:189
Binary Tree Right Side View
Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For exampl...
分类:其他好文   时间:2015-04-12 11:48:52    阅读次数:100
Binary Tree Right Side View--LeetCode
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. For example: Given the following binary tree, 1 ...
分类:其他好文   时间:2015-04-12 10:41:52    阅读次数:149
LeetCode Maximal Rectangle
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area. 题意:求0,1矩阵中,1构成的最大矩阵。 思路:借用了上一题,首先我们先计算出dp[i][j]表示到第i行第j列时,此时这一列的连续1的个数,然后计算每一行...
分类:其他好文   时间:2015-04-12 10:37:34    阅读次数:118
【LeetCode】199. Binary Tree Right Side View
Binary Tree Right Side ViewGiven a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered fr...
分类:其他好文   时间:2015-04-11 19:09:34    阅读次数:124
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!