1.建立一个连接需要三次握手:位码即tcp标志位,有6种标示:SYN(synchronous建立联机)
ACK(acknowledgement 确认) PSH(push传送) FIN(finish结束) RST(reset重置)
URG(urgent紧急)Sequence number(顺序号码) ...
分类:
其他好文 时间:
2014-05-29 04:17:13
阅读次数:
354
给定一个字符串满足规律 11212312345……,求其第k位的数字。算法思路:分组来看,第一组1
第二组12 第三组123 第K组[1:k]1-9组每组1位, 10-99组每组2位
依次类推。网上大部分解法,用一个数组表示到第k组时,一共需要多少位数,但这个方法需要额外的空间,而且空间大小并不是非...
分类:
其他好文 时间:
2014-05-29 02:46:29
阅读次数:
272
题目: Say you have an array for which the ith element
is the price of a given stock on day i. Design an algorithm to find the maximum
profit. You may co...
分类:
其他好文 时间:
2014-05-28 22:37:18
阅读次数:
327
最近要毕业了,有半年没做比赛了.这次参加百度之星的初赛娱乐一下.现在写一下解题报告.还是先看看四道题的类型吧1.Scenic
Popularity 暴力 复杂度O( 100 * 100 * 10000 ) 或者O( T * K * R) 线段树2.Chess DP
复杂度 O(n^2)3.Best ...
分类:
其他好文 时间:
2014-05-28 13:19:16
阅读次数:
261
DescriptionYou are given a sequence
ofnintegersa1, a2, ... , anin non-decreasing order. In addition to that, you are
given several queries consisting ...
分类:
其他好文 时间:
2014-05-28 03:20:48
阅读次数:
302
一个系列三道题,我都不会做,google之答案。过了两道,第三道看不懂,放置,稍后继续。一、Best
Time to Buy and Sell Stock
I题目:一个数组表示一支股票的价格变换。要求只买卖一次,获得最大收益。思路:一开始我认为是寻找最大、最小值,但由于最大值不一定总是出现在最小值的...
分类:
其他好文 时间:
2014-05-28 01:21:52
阅读次数:
262
题目: Say you have an array for which the ith element
is the price of a given stock on day i. If you were only permitted to complete
at most one transac...
分类:
其他好文 时间:
2014-05-28 00:55:20
阅读次数:
288
题目: Say you have an array for which the ith element
is the price of a given stock on day i. Design an algorithm to find the maximum
profit. You may co...
分类:
其他好文 时间:
2014-05-28 00:53:26
阅读次数:
338
题意:给定p数组 让求w数组 p数组;S (((()()()))) P-sequence 4 5
6666//)括号 左边(括号的个数 W-sequence 1 1 1456//)括号所匹配的括号中的括号对数用一个栈来模拟#includeusing
namespac...
分类:
其他好文 时间:
2014-05-28 00:46:16
阅读次数:
187
DescriptionGiven m sequences, each contains n
non-negative integer. Now we may select one number from each sequence to form a
sequence with m integers...
分类:
其他好文 时间:
2014-05-28 00:05:22
阅读次数:
298