【题目】
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
【题意】
给定一个mXn的矩阵,如果其中的元素为0,则对应的行和列都用0填充。
不能申请额外的空间。
【思路】
第一行和第一列空出来标记需要置0的列和行
第一遍扫描:
扫描第一行,判断第一行是否需要清零
...
分类:
其他好文 时间:
2014-06-05 08:07:11
阅读次数:
229
Reverse a linked list from positionmton. Do it
in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m=
2 andn= 4,return1->4->3->2->5->NULL.No...
分类:
其他好文 时间:
2014-06-04 18:55:07
阅读次数:
343
10 body language love signals 10种散发着爱情信号的肢体语言 Do
you ever wish there was a magic wand that would make you more attractive to the
opposite sex, or at l...
分类:
其他好文 时间:
2014-06-03 12:15:10
阅读次数:
359
1. Java代码的重构1. Java代码的重构 重构, 改善既有代码的设计 面向对象代码,
减少重复代码 Student 全部换成 Students 导入包, 就在上述Rename下选择Move进行包之间的移动 修改方法名称, 选中方法名称, 右键
上述操作中选择Pull up/Push do.....
分类:
系统相关 时间:
2014-05-31 17:07:23
阅读次数:
399
binlog启用和禁用在/etc/my.cnf文件中添加log-bin=mysql-bin来启用binlog,mysql-bin为日志文件名前缀。如果用户有super权限,可通过set
sql_log_bin=1/0来启用或禁用当前会话的binlog记录。binlog的设置A: binlog_do_...
分类:
其他好文 时间:
2014-05-31 15:09:00
阅读次数:
230
小学奥数读本(三年级),P133第13题。用一到九,九个数,组成一道除法算式:口口口口×口=口口口口 1 var 2 i,j,k:longint; 3
s:set of 0..9; 4 begin 5 for i:=1234 to 9876 do 6 for j:=2 to 9...
分类:
其他好文 时间:
2014-05-31 11:57:14
阅读次数:
178
看似简单的一个菜单,确需要不少的知识点1.
getByClassgetElementsByClassName
已经有大部分现代浏览器支持了,只有ie6,ie7,ie8是不支持的。所以对ie6,7,8做特别的处理就行,而ie里边有个内置的属性一直被我们所忽略,document.all,这个比一般的do...
分类:
Web程序 时间:
2014-05-31 08:20:41
阅读次数:
340
一 while循环二do while循环三
for循环for循环的执行顺序用如下表达式:for(expression1;expression2;expression3) 循环变量初值; 循环条件;
循环变量增量{ expression4;} 执行的顺序应该是:1)第一次循环,即初始化循环。 ...
分类:
编程语言 时间:
2014-05-31 01:00:04
阅读次数:
364
Given inorder and postorder traversal of a
tree, construct the binary tree.Note:You may assume that duplicates do not exist
in the tree./** * Definiti...
分类:
其他好文 时间:
2014-05-30 16:12:22
阅读次数:
288
Given preorder and inorder traversal of a tree,
construct the binary tree.Note:You may assume that duplicates do not exist in
the tree./** * Definitio...
分类:
其他好文 时间:
2014-05-30 16:02:40
阅读次数:
289