码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
LeetCode: Add Binary 解题报告
Add BinaryGiven two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".SOLUTION:指针指到两个字符串的末尾,不断往前推进,用carr...
分类:其他好文   时间:2014-10-26 22:40:47    阅读次数:339
常用算法
二分查找int binary_search(int a[],int len,int goal){ int beg = 0; int end = len - 1; while(beg goal) end = middle - 1; else ...
分类:编程语言   时间:2014-10-26 18:17:20    阅读次数:145
[Leetcode] Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ ...
分类:其他好文   时间:2014-10-26 15:33:29    阅读次数:141
[leetcode]Path Sum II
问题描述: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example: Given the below binary tree and sum = 22, 5 /...
分类:其他好文   时间:2014-10-26 14:24:00    阅读次数:224
[Leetcode] Balanced Binary Tree
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:其他好文   时间:2014-10-26 14:22:44    阅读次数:183
Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:其他好文   时间:2014-10-26 14:18:14    阅读次数:251
leetcode第一刷_Validate Binary Search Tree
有了上面的教训,这道题就简单多了,什么时候该更新pre是明白的了,倒是有个细节,二叉搜索树中是不同意有相等节点的,所以题目的要求用黑体字标明了。写的时候注意就能够了。class Solution {public: TreeNode *pre = NULL; bool isValidBST...
分类:其他好文   时间:2014-10-26 14:15:49    阅读次数:229
[leetcode] Path Sum
问题描述: 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. For example: Given the below binary tree...
分类:其他好文   时间:2014-10-26 13:11:29    阅读次数:177
HDU 5083 Instruction(字符串处理)
Problem Description Nowadays, Jim Green has produced a kind of computer called JG. In his computer, the instruction is represented by binary code. However when we code in this computer, we use some m...
分类:其他好文   时间:2014-10-26 11:49:22    阅读次数:357
Symmetric Tree 判断对称树
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ ...
分类:其他好文   时间:2014-10-26 11:37:08    阅读次数:195
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!