广播被分为两种不同的类型:“普通广播(Normal
broadcasts)”和“有序广播(Ordered broadcasts)”。
普通广播是完全异步的,可以在同一时刻(逻辑上)被所有接收者接收到,相对有序广播消息传递的效率比较高,
但缺点是:接收者不能将处理结果传递给下一个接收者,并且无...
分类:
其他好文 时间:
2014-05-12 20:08:45
阅读次数:
370
1、
??
Surrounded Regions
Given a 2D board containing 'X' and 'O',
capture all regions surrounded by 'X'.
A region is captured by flipping all 'O's into 'X's
in that surrounded region.
For e...
分类:
其他好文 时间:
2014-05-11 18:52:32
阅读次数:
293
Substring时间限制:1000 ms | 内存限制:65535 KB难度:1描述You
are given a string input. You are to find the longest substring of input such
that the reversal of the ...
分类:
其他好文 时间:
2014-05-10 06:20:56
阅读次数:
257
一.最长公共子序列(LCS Longest Common
Subsequence)第一,先说区别,最长公共子串和最长公共子序列是不一样的。最长公共子串不许是连续的,而最长公共子序列可以是不联系的。网络上解释的子序列:一个字符串S,去掉零个或者多个元素所剩下的子串称为S的子序列。最长公共子序列就是寻找...
分类:
其他好文 时间:
2014-05-10 01:12:20
阅读次数:
370
题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4535
How Many Sets I
Time Limit: 2 Seconds Memory Limit: 65536 KB
Give a set S, |S| = n, then how many ordered set g...
分类:
其他好文 时间:
2014-05-09 13:50:00
阅读次数:
347
http://oj.leetcode.com/problems/longest-valid-parentheses/ 1 class Solution: 2 #
@param s, a string 3 # @return an integer 4 def longestVa...
分类:
编程语言 时间:
2014-05-09 00:11:38
阅读次数:
410
Longest Valid Parentheses
分类:
其他好文 时间:
2014-05-08 21:00:03
阅读次数:
282
这道题做的不够顺利,许多次通过,但是居然是卡在一个小问题上了,判断strs是否为空,我想当然地就写成了if(strs
== null) return null;
报错java中null表示还没new出对象,就是还没开辟空间;“”表示new出了对象,但是这个对象装的是空字符串。这里显然是要应对strs...
分类:
其他好文 时间:
2014-05-08 15:16:16
阅读次数:
291
时间限制:300MS 内存限制:1000K提交次数:255 通过次数:118题型:
编程题语言: 无限制DescriptionA numeric sequence of ai is ordered if a1
a[j],j大于等于1且小于i,i>1;(3)f(i) = 1 当对任意j,(j大于等于1...
分类:
其他好文 时间:
2014-05-08 06:18:11
阅读次数:
682
给你一个数组,O(N)时间找出某些个数,这些题如果没见过,还真不是很好想。做了这些题,我觉得有下面两个个比较常见的思路:
1. 用两个指针,可以从一边开始,走某个距离停止,也可能是一头一尾两个指针,定义一种大小关系,他俩比较之后移动,直到相遇。
2. 用其他的辅助的数据结构,可能是hash表,可能是map,可能是栈或者队列。这种通常用在访问了现在的不能确定他们是不是有用,是不是能影响最后的结果...
分类:
其他好文 时间:
2014-05-07 07:50:33
阅读次数:
392