Given an array "nums" of integers and an int "k", Partition the array (i.e move the elements in "nums") such that, * All elements = k are moved to ...
分类:
其他好文 时间:
2015-04-02 06:38:14
阅读次数:
172
原文地址目录介绍(Introduction)相似点(Similarities)编译单位(Compiled Units)命名空间(Namespaces)顶层成员(类型)(Top Level Elements(Types))基础类型(Basic Types)类(Classes)结构体(Structure...
分类:
编程语言 时间:
2015-04-01 17:26:44
阅读次数:
300
problem:
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
For example,
Given the following matrix:
[
[ 1, 2, 3 ],
[ 4, 5, 6 ],...
分类:
其他好文 时间:
2015-04-01 11:26:55
阅读次数:
109
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题解:递归就可以了。Java代码如下: 1 /** 2 * Definition for binary ....
分类:
其他好文 时间:
2015-04-01 00:16:07
阅读次数:
96
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
之前在Sicily做过,就是实现一个AVL树了。
struct TreeNodeNew {
int val;
TreeNodeNew *left;
Tr...
分类:
其他好文 时间:
2015-03-31 18:09:23
阅读次数:
150
STL源码分析 # vector #
下面是一个使用vector的demo:
#include
#include
using namespace std;
int main()
{
/*
** To create a vector which contain 10 elements and the value
** of each element i...
分类:
其他好文 时间:
2015-03-31 18:03:36
阅读次数:
160
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 mat...
分类:
其他好文 时间:
2015-03-31 17:40:27
阅读次数:
114
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 mat...
分类:
其他好文 时间:
2015-03-31 17:29:00
阅读次数:
100
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
For example,
Given [100, 4, 200, 1, 3,
2],
The longest consecutive elements sequence is [1,
2,...
分类:
其他好文 时间:
2015-03-30 21:11:03
阅读次数:
115
Given a collection of integers that might contain duplicates,S, return all possible subsets.Note:Elements in a subset must be in non-descending order....
分类:
其他好文 时间:
2015-03-30 18:18:11
阅读次数:
113