Link:http://oj.leetcode.com/problems/swap-nodes-in-pairs/Given a linked list,
swap every two adjacent nodes and return its head.For example,Given1->2-...
分类:
其他好文 时间:
2014-05-05 22:45:37
阅读次数:
331
ismember 判断A中的元素在B中有没有出现 LIA = ismember(A,B)
for arrays A and B returns an array of the samesize as A containing true where
the elements of A are i...
分类:
其他好文 时间:
2014-05-05 22:25:11
阅读次数:
317
1. introductionfrom numpy import
*random.rand(4,4)#array to matrixrandMat=mat(randon.rand(4,4))#matrix
inverseIvrandMat=randMat.I#indentity matrixeye(...
分类:
编程语言 时间:
2014-05-05 22:24:10
阅读次数:
336
#include #include #include using namespace std;int
n,leap;int vis[12];void dfs(int index,int num){ if(leap) return ; if(index>n)
{ ...
分类:
其他好文 时间:
2014-05-05 22:01:05
阅读次数:
593
题目链接:http://poj.org/problem?id=1011
这道题用到了深搜+剪枝。
#include
#include
#include
using namespace std;
int a[65];
int vis[65];
int n;
int cmp(int x,int y)
{
return x>y;
}
int dfs(int len,int need,int ...
分类:
其他好文 时间:
2014-05-05 13:28:57
阅读次数:
290
Vitaly has an array of n distinct integers. Vitaly wants to divide this array into three non-empty sets
so as the following conditions hold:
The product of all numbers in the first set is less ...
分类:
其他好文 时间:
2014-05-03 23:51:19
阅读次数:
621
题目
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
Have you thought about this?
Here are some good questions to ask before coding. Bonus points...
分类:
其他好文 时间:
2014-05-03 17:35:30
阅读次数:
345
Sliding Window
Time Limit: 12000MS
Memory Limit: 65536K
Total Submissions: 36315
Accepted: 10756
Case Time Limit: 5000MS
Description
An array of size n ≤ 106 is gi...
auto root = Dictionary::create();
auto string = String::create("string element value");
root->setObject(string, "string element key");
auto array = Array::create();
...
分类:
其他好文 时间:
2014-05-03 16:27:48
阅读次数:
380
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 exa...
分类:
其他好文 时间:
2014-05-03 15:47:53
阅读次数:
289