Given a m x n matrix,
if an element is 0, set its entire row and column to 0. Do it in place.
解题思路:题目很简单,可就是没想到有什么高效的方法.我遍历了两遍vector,显得有点复杂.
#include
#include
using namespace std;
void setZeroes(v...
分类:
其他好文 时间:
2015-02-03 21:26:02
阅读次数:
168
这一篇再说下索引的最后一个主题,索引覆盖,当然学习比较好的捷径是看看那些大师们设计的索引,看从中能提取些什么营养的东西,下面我们看看数据库中一个核心的Orders表。 一:查看表的架构 先查看这个表的大概架构信息1 --查看表的架构信息2 SELECT c.column_id,c.name,t...
分类:
数据库 时间:
2015-02-03 14:57:50
阅读次数:
253
如果是用xml的方式配置映射,可以在标签的sql-type属性中设置char(2),比如: 1 2 3 如果是注解的话,需要使用@Column的columnDefinition属性,比如:@Column(name="age",columnDefinition="char(2)")...
分类:
Web程序 时间:
2015-02-03 12:59:55
阅读次数:
155
主键约束SELECT USER_CONS_COLUMNS.CONSTRAINT_NAME AS 约束名, USER_CONS_COLUMNS.TABLE_NAME AS 表名, USER_CONS_COLUMNS.COLUMN_NAME AS 列名, USER_CONS_COLUMNS.POSITI...
分类:
数据库 时间:
2015-02-03 12:34:04
阅读次数:
147
WebSettings webSettings= webView.getSettings();webSettings.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);LayoutAlgorithm是一个枚举,用来控制html的布局,总共有三种类型:...
分类:
Web程序 时间:
2015-02-03 10:58:14
阅读次数:
95
原题地址注意从1开始索引,所以记得+1代码: 1 int titleToNumber(string s) { 2 int res = 0; 3 4 for (int i = 0; i < s.length(); i++) { 5 ...
分类:
其他好文 时间:
2015-02-02 19:42:12
阅读次数:
145
原题地址26进制数注意,编号是从1开始的,所以取模取商之前要-1代码: 1 string convertToTitle(int n) { 2 string res; 3 4 while (n) { 5 res = (char)...
分类:
其他好文 时间:
2015-02-02 19:38:27
阅读次数:
145
name="xx属性" column="xx属性id" class="xx类" key column="本类id"
column=“ ”这个id在自己那一方 ,索引对方的外键
key column=“ ”这个id在对方那一方 ,自己能被索引的外键
一对一
多对一
一对多
...
分类:
Web程序 时间:
2015-02-02 16:01:33
阅读次数:
161
http://blog.csdn.net/column/details/nio-mina-source.htmlhttp://blog.csdn.net/chaofanwei/article/details/38848085http://blog.csdn.net/chaofanwei/articl...
分类:
其他好文 时间:
2015-02-02 14:00:40
阅读次数:
103
The Employee table holds all employees including their managers. Every employee has an Id,
and there is also a column for the manager Id.
+----+-------+--------+-----------+
| Id | Name | Salary |...
分类:
数据库 时间:
2015-02-01 21:55:11
阅读次数:
418