Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri...
分类:
其他好文 时间:
2014-06-18 21:56:47
阅读次数:
209
Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ],...
分类:
其他好文 时间:
2014-06-18 21:56:06
阅读次数:
215
Test for Job
Time Limit: 5000MS
Memory Limit: 65536K
Total Submissions: 8990
Accepted: 2004
Description
Mr.Dog was fired by his company. In order to support his famil...
分类:
其他好文 时间:
2014-06-18 11:17:50
阅读次数:
177
Teradata数据库中也有和oracle类似的分析函数,功能基本一样。示例如下:RANK() 函数SELECT * FROM salestbl ORDER BY 1,2;storeid prodid sales----------- ------- ---------1001 ...
分类:
其他好文 时间:
2014-06-18 10:29:26
阅读次数:
272
命令模式(command pattern) 撤销(undo) 详解本文地址: http://blog.csdn.net/caroline_wendy参考命令模式: http://blog.csdn.net/caroline_wendy/article/details/31379977命令模式可以用于执行撤销(undo)操作.具体方法:1. 对象类中需要保存状态, 如level.package co...
分类:
其他好文 时间:
2014-06-17 22:19:07
阅读次数:
229
题目
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" ...
分类:
其他好文 时间:
2014-06-17 21:34:00
阅读次数:
189
rownum是oracle的一个伪劣,它的顺序根据从表中获取记录的顺序递增,这里要注意的是:由于记录在表中是无序存放的,因此你无法通过简单的rownum和order by的组合获得类似TOP N的结果。
我们的测试数据如下:
select * from test;
ID NAME
---------- --------------------
1 A...
分类:
数据库 时间:
2014-06-17 19:29:14
阅读次数:
275
题目
Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be changed. It doesn't matter what you leave beyond the new ...
分类:
其他好文 时间:
2014-06-16 23:07:18
阅读次数:
188
在Oracle 10g下,来到scott用户下,分别以层次 1,2,3,4上的节点做实验:
当start with是根节点(level=1),要查其子节点,connect by pump和emp都是被扫描4次(总的层次)。
当start with是根节点(level=2),要查其子节点,connect by pump和emp被扫描3次。
当start wi...
分类:
数据库 时间:
2014-06-16 22:10:00
阅读次数:
232
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
For example:
Given "25525511135",
return ["255.255.11.135", "255.255.111.35"].
(Order do...
分类:
其他好文 时间:
2014-06-16 19:24:42
阅读次数:
248