//定义二维平面上的点struct Point{ int x; int y;
Point(int a=0, int b=0):x(a),y(b){}};bool operator==(const Point& left,
const Point& right){ return...
分类:
其他好文 时间:
2014-06-08 22:26:17
阅读次数:
357
1.基本概念:sleep,join,yied,优先级.2.进程,线程:独立的内存空间,内存地址,不会相互影响。3.数据结构:(共享资源的软件模拟)-队列,4.并发控制:信号量机制(硬件机制原理),软件实现(锁机制-比如读写分离,基于二维的锁兼容性)5.障碍器,信号量,锁6.CPU密集型--计算,I/...
分类:
编程语言 时间:
2014-06-08 21:38:34
阅读次数:
498
jQuery 顶部导航跟随滚动,固定浮动在顶部演示 XML/HTML Codesection> article class="left"> p> p> ul> li>a href="http://freejs.net/article_jquerywenzi_149.html" title="Ajax 动态加载内容">Ajax 动态加载内容a>li> li>a href="htt...
分类:
Web程序 时间:
2014-06-08 18:15:37
阅读次数:
215
题目
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For example:
G...
分类:
其他好文 时间:
2014-06-08 17:29:07
阅读次数:
315
1. 递归解法
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
cl...
分类:
其他好文 时间:
2014-06-08 16:51:59
阅读次数:
199
题目
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
/ \...
分类:
其他好文 时间:
2014-06-08 16:38:02
阅读次数:
194
Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.
You should pack your words in a greedy approach; that i...
分类:
编程语言 时间:
2014-06-08 15:25:00
阅读次数:
282
题目
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree {3,9,20...
分类:
其他好文 时间:
2014-06-08 09:23:34
阅读次数:
230
android 中使用Canvas的drawText绘制文本的位置,是基于基线的。如下图:
其中字母Q的小尾巴在横线下面了。
怎么样找准字母的中心位置呢?
先看下面的例子:(右边的数字,表示字体的 left, top, right, bottom)
这里面的关键是Paint.getTextBound。 getTextBound会填充一个Rect,这个Rect表示...
分类:
移动开发 时间:
2014-06-08 09:08:44
阅读次数:
279
Rotating Sentences
In ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the input sentences from left to right and top to b...
分类:
其他好文 时间:
2014-06-08 04:51:34
阅读次数:
236