The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total num ...
分类:
编程语言 时间:
2016-10-20 00:14:38
阅读次数:
133
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. For example, given the following ...
分类:
编程语言 时间:
2016-10-19 13:20:22
阅读次数:
175
题意 给一棵满二叉树,每一层有一个变量,每个变量都有一个值:0或1。0向左走,1向右走。求到达叶子的值 思路 不用建树,只要模拟左走右走就可以了 总结 建树应该也能做,但是目前对建树有点生疏,不是很会。 在推左走右走的公式时能快一点最好,明明很容易,却找共性找了很久,而且DEBUG了很久,就是因为在 ...
分类:
其他好文 时间:
2016-10-18 18:40:14
阅读次数:
177
1. DocumentsCluster will not support SELECT, it only contains database 0.All the nodes use TCP bus and binary protocol to communicate. Every node conn ...
分类:
其他好文 时间:
2016-10-18 18:29:58
阅读次数:
221
从BST中移除一个节点是比较复杂的问题,需要分好几种情况讨论。 如这篇文章,就讨论了删除节点 1.有无左右子树 2.只有右子树 3.只有左子树 三种情况。 一种简单些的思维是只考虑删除节点是否有右子树(因为第一个比删除节点大的节点可能出现在右子树,不会出现在左子树)。 这里用Target表示删除节点 ...
分类:
其他好文 时间:
2016-10-18 11:35:16
阅读次数:
144
这个题不难,但是挺有趣的。 1.就是在每个递归的时候,传一个index进去,如果根节点是0,那么左子树就是-1,右子树就是1。 左子树的左子树就是-1,左子树的右子树就是0,etc 2.然后这道题还有一个坑,就是要level order,所以必须bfs,如果dfs递归的话,相同的index的节点输出 ...
分类:
其他好文 时间:
2016-10-18 07:42:27
阅读次数:
210
1018. Binary Apple Tree Time limit: 1.0 secondMemory limit: 64 MB Let's imagine how apple tree looks in binary computer world. You're right, it looks ...
分类:
移动开发 时间:
2016-10-15 22:24:46
阅读次数:
258
UniqueIdentifier 数据类型用于存储GUID的值,占用16Byte。 SQL Server将UniqueIdentifier存储为16字节的二进制数值,Binary(16),按照特定的格式显示,显示的格式是:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,其中 ...
分类:
其他好文 时间:
2016-10-15 22:24:22
阅读次数:
184
An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black pixels are connected, i.e., there is only one bla ...
分类:
其他好文 时间:
2016-10-15 13:38:57
阅读次数:
124
题目链接:http://lightoj.com/volume_showproblem.php?problem=1418 题意:给你多边形中的顶点,n个点按顺时针或逆时针方向给出,然后求出多边形内部有多少个整数点; 皮克定理: 在一个多边形中。用I表示多边形内部的点数,E来表示多边形边上的点数,S表示 ...
分类:
其他好文 时间:
2016-10-14 16:49:29
阅读次数:
197