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 comple ...
分类:
其他好文 时间:
2017-07-16 15:47:41
阅读次数:
132
1. 客户端与服务器端建立TCP/IP连接后关闭SOCKET后,服务器端连接的端口状态为TIME_WAIT; 2. 主动关闭的Socket端会进入TIME_WAIT状态,并且持续2MSL时间长度,MSL就是maximum segment lifetime(最大分节生命期); 这是一个IP数据包能在互 ...
分类:
其他好文 时间:
2017-07-16 14:19:18
阅读次数:
131
Given an array consisting of n integers, find the contiguous subarray whose length is greater than or equal to k that has the maximum average value. A ...
分类:
其他好文 时间:
2017-07-16 14:16:39
阅读次数:
283
Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the ...
分类:
其他好文 时间:
2017-07-16 14:15:52
阅读次数:
175
Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ? s. If there isn't ...
分类:
其他好文 时间:
2017-07-16 13:40:37
阅读次数:
165
1、MTU的概念 MTU即Maximum Transmission Unit 最大传输单元。它是指一种通信协议的某一层上面所能通过的最大数据包大小(以字节为单位)。 2、路径MTU 路径MTU是指一条因特网传输路径中,从源地址到目的地址所经过的“路径”上的所有IP跳的最大传输单元的最小值。 或者从另 ...
分类:
其他好文 时间:
2017-07-16 11:17:01
阅读次数:
400
Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Example 2: 思路: 将0改为-1,将原题目改成求最大连续区间,区间 ...
分类:
其他好文 时间:
2017-07-16 00:03:16
阅读次数:
150
这道题是一道典型的位操作Bit Manipulation的题目,我开始以为异或值最大的两个数一定包括数组的最大值,但是OJ给了另一个例子{10,23,20,18,28},这个数组的异或最大值是10和20异或,得到30。那么只能另辟蹊径,正确的做法是按位遍历,题目中给定了数字的返回不会超过231,那么 ...
分类:
其他好文 时间:
2017-07-15 23:58:08
阅读次数:
482
Building designing Time limit: 3.000 seconds An architect wants to design a very high building. The building will consist of some ?oors, and each ?oor ...
分类:
其他好文 时间:
2017-07-15 16:49:55
阅读次数:
167
转载自http://www.renfei.org/blog/bipartite-matching.html 二分图的最大匹配、完美匹配和匈牙利算法 这篇文章讲无权二分图(unweighted bipartite graph)的最大匹配(maximum matching)和完美匹配(perfect m ...
分类:
编程语言 时间:
2017-07-14 22:14:40
阅读次数:
233