Spiral Matrix IIGiven an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the...
分类:
其他好文 时间:
2014-12-08 22:36:48
阅读次数:
199
Given a set of distinct integers, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.
For example,...
分类:
编程语言 时间:
2014-12-08 21:29:03
阅读次数:
285
Spiral MatrixGiven a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[...
分类:
其他好文 时间:
2014-12-08 21:08:34
阅读次数:
153
【题目】
Given a set of distinct integers, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.
...
分类:
其他好文 时间:
2014-12-08 17:47:58
阅读次数:
191
前言:
大话设计模式中一直提到GoF,猜想应该是某位创建设计模式的鼻祖大牛,百度之后发现GoF原意:
设计模式的经典名著——Design Patterns: Elements of Reusable Object-Oriented Software,中译本名为《设计模式——可复用面向对象软件的基础》的四位作者Erich Gamma、Richard Helm、Ralph Johnson,以及Jo...
分类:
其他好文 时间:
2014-12-07 17:49:49
阅读次数:
222
给定一个数组,找出里面连续的子序列的最长长度。例如:Given[100, 4, 200, 1, 3, 2],The longest consecutive elements sequence is[1, 2, 3, 4]. Return its length:4.思路一:排序,然后count一下就o...
分类:
其他好文 时间:
2014-12-06 20:15:40
阅读次数:
166
1 Reada set of integers into a vector. Print the sum of each pair of adjacent elements.Change your program so that it prints the sum of the first and last elements,followed by the sum of the second an...
分类:
编程语言 时间:
2014-12-05 21:17:08
阅读次数:
314
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
深搜+递归
/**
* Definition for binary tree
* public class TreeNode {
* int val;
* Tree...
分类:
其他好文 时间:
2014-12-05 17:34:59
阅读次数:
169
SubsetsGiven a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must...
分类:
其他好文 时间:
2014-12-05 12:23:05
阅读次数:
145
在CSS中,使用display属性来定义盒的类型。总体来说,盒类型分为两类:inline和block。如div默认是block,span默认是Inline。可以通过display修改默认的表现方式。
block and inline elements
<style ty...
分类:
Web程序 时间:
2014-12-05 10:58:33
阅读次数:
301