Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given intege ...
分类:
其他好文 时间:
2017-04-29 23:39:06
阅读次数:
346
$arr = array(4,58,11,34,88,45,32,54,63,78); function binary($arr,$bnum){ if(is_array($arr) && count($arr) > 0) { sort($arr); $start = 0; $end = count( ...
分类:
其他好文 时间:
2017-04-29 21:00:25
阅读次数:
132
相应POJ 题目:点击打开链接 Binary Search Heap Construction Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 9075 Accepted: 2566 Description Read the st ...
分类:
其他好文 时间:
2017-04-29 18:54:15
阅读次数:
206
Lowest Common Ancestor of a Binary Tree Total Accepted: 1628 Total Submissions: 5660 Given a binary tree, find the lowest common ancestor (LCA) of two ...
分类:
其他好文 时间:
2017-04-29 13:46:28
阅读次数:
145
Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 unique BST ...
分类:
其他好文 时间:
2017-04-29 13:44:26
阅读次数:
164
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". public class Solution { public String a ...
分类:
其他好文 时间:
2017-04-29 11:53:48
阅读次数:
127
题目:给定一个二叉树,找到其最小深度。最小深度是从根节点到最近叶节点的最短路径的节点数。 ...
分类:
其他好文 时间:
2017-04-28 23:45:42
阅读次数:
152
【题目】 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 ...
分类:
其他好文 时间:
2017-04-28 13:36:21
阅读次数:
133
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 题意:二进制的加法。 思路:跟大数加法差点儿相同。 class Solutio ...
分类:
其他好文 时间:
2017-04-27 23:14:47
阅读次数:
200
地址:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3965 题目: iven two depth-first-search (DFS) sequences of a binary tree, can you find a ...
分类:
其他好文 时间:
2017-04-27 23:06:45
阅读次数:
532