Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l...
分类:
其他好文 时间:
2014-07-10 12:37:21
阅读次数:
189
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
分类:
其他好文 时间:
2014-07-07 23:02:31
阅读次数:
193
一、 * *** ************ 打印出上面的图案, ***** *** * 通常的做法是把整个图案分成两部分,做两次循环即可得到这个图案,网上有很多这样的程序,百度即可,今天在这里就不介绍这个方法了,要介绍的是下面的程序, /** * 将整个图案以中心点为原点画个坐标,定义行数row,然...
分类:
其他好文 时间:
2014-07-07 23:01:47
阅读次数:
212
DataFrame的基本操作 1,选择 (1),Select column In [11]: df['a']Out[11]:0 -1.3552631 0.0108882 1.5995833 0.0045654 0.460270Name: a, dtype: float64(2),Select row...
分类:
其他好文 时间:
2014-07-07 21:43:31
阅读次数:
309
和POJ2676一样哈,,,
原谅我水题目数 = =!。。。
#include
#include
#include
#include
using namespace std;
int map[10][10];
char tmp[10][10];
bool row[10][10];
bool col[10][10];
bool grid[10][10];
bool DFS(int x,i...
分类:
其他好文 时间:
2014-06-30 07:44:27
阅读次数:
226
下面是摘自网络的一段话,我觉得很好;对认识锁很有帮助。
“为什么要加锁?加锁是为了防止不同的线程访问同一共享资源造成混乱。
打个比方:人是不同的线程,卫生间是共享资源。
你在上洗手间的时候肯定要把门锁上吧,这就是加锁,只要你在里面,这个卫生间就被锁了,只有你出来之后别人才能用。想象一下如果卫生间的门没有锁会是什么样?
什么是加锁粒度呢?所谓加锁粒度就是你要锁住的范围是多大。
比如你在家上...
分类:
其他好文 时间:
2014-06-29 23:50:07
阅读次数:
362
Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra space?A s...
分类:
其他好文 时间:
2014-06-28 09:55:50
阅读次数:
205
Re'entrantLock lock = new ReentrantLock(fair);
Condition
notEmpty = lock.newCondition(); //返回内部类 AbstractQueuedSyncronizer.ConditionObject
各自维护了两个队列.一个是阻塞同步队列 syncQueue 双向队列,一个是条件等待队列....
分类:
数据库 时间:
2014-06-27 09:10:37
阅读次数:
505
在查询时,如果使用到LIKE关键字,就要注意有没有使用到索引;没有使用索引前:mysql>explainselect*fromemployeeswherefirst_name=‘Georgi‘\G;***************************1.row***************************id:1select_type:SIMPLEtable:employeestype:ALLpossible_keys:NU..
分类:
数据库 时间:
2014-06-27 06:10:07
阅读次数:
272