来源: Backdoor CTF 2015 There is a wierd kind of authentication service running: nc hack.bckdr.in 8004. The binary can be found here. The vampire says t...
分类:
其他好文 时间:
2015-04-19 15:59:21
阅读次数:
194
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的矩阵的面积。
算法一,动态规划
此题,以每行为底,都可以转换成是一个Largest
Rec...
分类:
其他好文 时间:
2015-04-19 14:45:57
阅读次数:
115
public class Solution { public int findPeakElement(int[] num) { // binary search http://siddontang.gitbooks.io/leetcode-solution/content/arr...
分类:
其他好文 时间:
2015-04-19 14:34:05
阅读次数:
98
题目描述Given a binary tree, flatten it to a linked list in-place.For example,
Given
The flattened tree should look like:
本题也是考察二叉树和指针操作的题目。题目要求将一棵二叉树拉平为一个链表 。链表通过树节点的右子树相连,且展开的顺序为原来树的前序遍历。实现思路:
若节点n存...
分类:
其他好文 时间:
2015-04-18 23:48:59
阅读次数:
213
https://leetcode.com/problems/unique-binary-search-trees-ii/Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n...
分类:
其他好文 时间:
2015-04-18 23:18:39
阅读次数:
122
题目描述Write a function that takes an unsigned integer and returns the number of ’1’ bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11’ has binary representation 000000000...
分类:
其他好文 时间:
2015-04-18 22:02:38
阅读次数:
128
题目描述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 and sum...
分类:
其他好文 时间:
2015-04-18 22:01:55
阅读次数:
136
$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($arr)-...
分类:
其他好文 时间:
2015-04-18 21:50:07
阅读次数:
105
这题也是第二次做,本想第一次做时参考的算法会和老师讲的一样,不想老师讲的算法用在这题感觉还不如思雪园友的算法(http://www.cnblogs.com/sixue/archive/2015/04.html)来的简单,不过老师给的思路是一种挺通用的思路,可以用来解决一系列的问题,但我目前看着有点吃...
分类:
其他好文 时间:
2015-04-18 12:54:00
阅读次数:
187
switch在判断分支时,没有判断所有的可能性,而是用一个静态表来解决这个问题,所以速度要比if-else快。但是,switch对较复杂的表达式进行判断,所以当我们需要判断一些简单数值时,用switch较好。下面是转载的内容,我看说的很有道理switch和if-else相比,由于使用了Binary ...
分类:
其他好文 时间:
2015-04-18 11:28:11
阅读次数:
105