Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ],...
分类:
其他好文 时间:
2015-07-12 23:11:36
阅读次数:
125
用并查集查找根节点,包括三种方法:1.朴素查找法:int find(int x){ int r = x; while(father[r] != r) r = father[r]; return r;}2.路径压缩(递归):int find(int x){ if(...
分类:
其他好文 时间:
2015-07-12 23:05:37
阅读次数:
119
普通URL提交参数该格式url为:url.do?param1=mahc¶m2=8888.00需要在上文中的HelloController对象添加方法如下:?1234567891011/*** Spring MVC URL提交参数* @param name* @return*/@Request...
分类:
编程语言 时间:
2015-07-12 21:32:23
阅读次数:
163
题目:
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in t...
分类:
编程语言 时间:
2015-07-12 20:23:34
阅读次数:
120
/** * 判断事件是否在控件中 * * @param view * @param ev * @return * @see http://m.blog.csdn.net/blog/aygxylxk/8950268 */public static boolean inRangeOfView(View....
分类:
移动开发 时间:
2015-07-12 17:16:49
阅读次数:
142
https://leetcode.com/problems/climbing-stairs/ 1 class Solution { 2 public: 3 int climbStairs(int n) { 4 if(n==1) 5 return 1; ...
分类:
其他好文 时间:
2015-07-12 17:09:48
阅读次数:
107
Given a sorted integer array without duplicates, return the summary of its ranges.For example, given[0,1,2,4,5,7], return["0->2","4->5","7"].思路:采用双指针 ...
分类:
其他好文 时间:
2015-07-12 17:07:47
阅读次数:
161
Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.public class Solution { ...
分类:
其他好文 时间:
2015-07-12 17:01:11
阅读次数:
107
Then-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all distinc...
分类:
其他好文 时间:
2015-07-12 16:58:46
阅读次数:
142
Remove all elements from a linked list of integers that have value val.
Example
Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6
Return: 1 --> 2 --> 3 --> 4 --> 5
/**
* Definit...
分类:
其他好文 时间:
2015-07-12 15:50:47
阅读次数:
121