码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
Binary Tree Level Order Traversal
class Solution {public:vector > res;public:void trval(TreeNode *root,int level){if(root==NULL)return;if(level==res.size()){vector v;res.push_back(v);}...
分类:其他好文   时间:2015-05-17 18:10:38    阅读次数:92
Unique Binary Search Trees
二叉排序树(二叉排序树(Binary Sort Tree)又称二叉查找树(Binary Search Tree),亦称二叉搜索树。)或者是一棵空树,或者是具有下列性质的二叉树:(1)若左子树不空,则左子树上所有结点的值均小于它的根结点的值;(2)若右子树不空,则右子树上所有结点的值均大于或等于它的根...
分类:其他好文   时间:2015-05-17 16:32:27    阅读次数:130
Balanced Binary Tree
递归,求左右是否平衡,再判断高度差classSolution{public:boolisBalanced(TreeNode*root){//StarttypingyourC/C++solutionbelow//DONOTwriteintmain()functionintheight;returnhe...
分类:其他好文   时间:2015-05-17 16:30:19    阅读次数:170
leetcode_Search for a Range
1.二分查找,找到value为target的一个元素的位置,找不到返回[-1,-1] 2.假设找到位置,且为index,分别向两边拓展即可。...
分类:其他好文   时间:2015-05-17 15:20:18    阅读次数:85
leetcode_Search Insert Position
1.变形的二分查找问题 2.最后A[mid]=target,index=mid 3.最后A[mid]!=target,又分A[mid]target两种情况, 4.if(A[mid]target),index=mid;...
分类:其他好文   时间:2015-05-17 15:18:22    阅读次数:106
【Path Sum】cpp
题目: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 sum...
分类:其他好文   时间:2015-05-17 02:03:11    阅读次数:116
CSAPP Lab2: Binary Bomb
著名的CSAPP实验:二进制炸弹就是通过gdb和反汇编猜测程序意图,共有6关和一个隐藏关卡只有输入正确的字符串才能过关,否则会程序会bomb终止运行隐藏关卡需要输入特定字符串方会开启实验材料下载地址:http://csapp.cs.cmu.edu/2e/labs.html下面通关解法:反汇编:obj...
分类:移动开发   时间:2015-05-17 00:48:16    阅读次数:940
【Maximum Depth of Binary Tree 】cpp
题目:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest...
分类:其他好文   时间:2015-05-17 00:40:24    阅读次数:126
ASP.NET Web API 2.1支持Binary JSON(Bson)
ASP.NET Web API 2.1内建支持XML、Json、Bson、form-urlencoded的MiME type,今天重点介绍下Bson。 BSON是由10gen开发的一个数据格式,目前主要用于MongoDB中,是MongoDB的数据存储格式。BSON基于JSON格式,选择JSON进行改...
分类:Windows程序   时间:2015-05-16 23:07:10    阅读次数:334
[LeetCode] Maximum Depth of Binary Tree
Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node....
分类:其他好文   时间:2015-05-16 20:38:48    阅读次数:152
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!