span{word-break:normal;width:auto;display:block;white-space:pre-wrap;word-wrap:break-word;overflow:hidden;} white-space -- 通过HTML文档的源代码的排版方式控制页面显示文本的排...
分类:
其他好文 时间:
2014-07-10 00:07:38
阅读次数:
332
1) 网站上经常会出现用户输入一大段字符和字母以至于文字无法正常折行,把版式破坏,这样我们就要参考以下样式:word-wrap:break-word; overflow:hidden; 当然必须得有宽度属性值。2) 文字过长要出现省略号样式如下:white-space: nowrap; text-o...
分类:
Web程序 时间:
2014-07-09 23:51:24
阅读次数:
474
文章来源——博客园绿色冰点前几次我们分析了Linux系统中用户进程的4G虚存大致分为了几个部分,介绍了3G用户空间中数据段,代码段等静态区域的虚存管理,重点分析了栈的使用。这次我们来分析一下虚存使用中另一个重要部分--堆。前面的介绍中,我们知道编译器,操作系统担负着大量栈分配管理的工作。不论是静态分...
分类:
系统相关 时间:
2014-07-07 18:29:08
阅读次数:
203
【题目】
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.
For example, given
s = "leetcode",
dict = ["leet", "code"].
Return true because "leetcode" can be segm...
分类:
其他好文 时间:
2014-06-30 09:02:26
阅读次数:
276
题目
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
Follow up:
Did you use extra space?
A straight forward solution using O(mn) space is probab...
分类:
其他好文 时间:
2014-06-30 06:17:09
阅读次数:
245
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1143
题意:逆时针给一个凸包的n(n
解法:求最短哈密顿本身是一个NP问题,但是因为是凸包上,可以利用这个做;有一个性质:凸包上的最短哈密顿路径不会出现交叉。所以可以看出来从一点出发,他要么和顺时针相邻点连接,要么和逆时针相邻点相连接;通过这个性质可以通过dp做:
ans[i][j...
分类:
其他好文 时间:
2014-06-30 06:11:07
阅读次数:
328
【题目】
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Follow up:
Can you solve it without using extra space?
【题意】
给定一个单向链表,如果链表有环,则返回环开始的位置。
【思路】
仍然是维护两个指针, p1, p2, p1每次走一步, p2每次走两步
...
分类:
其他好文 时间:
2014-06-29 23:59:21
阅读次数:
354
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1147
题意:一个10000*10000的矩阵,初始颜色都为1,然后最多2500次涂色,每次涂色将一个矩形的面积涂成某个特定颜色,问涂完之后每种颜色最终的面积。
解法:
代码:/*********************************************...
【题目】
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
【题意】
判断一个单向链表是否有环
【思路】
维护两个指针p1和p2,p1每次向前移动一步,p2每次向前移动两步
如果p2能够追上p1,则说明链表中存在环...
分类:
其他好文 时间:
2014-06-29 22:51:33
阅读次数:
267
对于大多数开发者而言,系统的内存分配就是一个黑盒子,就是几个API的调用。有你就给我,没有我就想别的办法。实际深入进去时,才发现这个领域里也是百家争鸣,非常热闹。有操作系统层面的内存分配器(Memory Allocator),有应用程序层面的,有为实时系统设计的,有为服务程序设计的。但他们的目的确认一样的,平衡内存分配的性能和提高内存使用的效率。...
分类:
其他好文 时间:
2014-06-29 20:33:05
阅读次数:
503