Problems:Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following ...
分类:
其他好文 时间:
2015-06-12 16:41:11
阅读次数:
71
problems: Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100".class Solution {public: string...
分类:
其他好文 时间:
2015-06-12 16:40:21
阅读次数:
71
function add(n1,n2){ return n1+n2; } function add(n1,n2,n3) { return n1+n2+n3; } alert(add(1,2));//N...
分类:
编程语言 时间:
2015-06-12 16:39:36
阅读次数:
97
Problem:Given a collection of numbers, return all possible permutations. For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3]...
分类:
其他好文 时间:
2015-06-12 16:39:01
阅读次数:
81
尾调用本文将以lua语言来描述。尾调用是函数式编程的一个概念,它是指某个函数的最后一步是调用另一个函数,例如:function f(x) return g(x) -- 尾调用end尾调用不一定出现在函数尾部,只要是最后一步操作即可,例如:function f(x) if (x > ...
分类:
其他好文 时间:
2015-06-12 16:38:07
阅读次数:
134
#includevoid quick_sort(int a[],int left,int right){ int l = left; int r = right; int n = a[left]; if(left >= right) return; whi...
分类:
编程语言 时间:
2015-06-12 16:30:16
阅读次数:
247
一、对int类型数组排序int num[100];int cmp ( const void *a , const void *b ){return *(int *)a - *(int *)b;}qsort(num,100,sizeof(num[0]),cmp);二、对char类型数组排序(同int类...
分类:
编程语言 时间:
2015-06-12 14:40:02
阅读次数:
197
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr...
分类:
其他好文 时间:
2015-06-12 13:07:15
阅读次数:
99
#include
int main(int argc, char** argv) {
int i = 1;
int *n ;
n=&i;
std::cout<<"i为:"<<i<<std::endl;
std::cout<<"n为:"<<n<<std::endl;
std::cout<<"*n为:"<<*n<<std::endl;
return 0;
}
调试截图...
分类:
编程语言 时间:
2015-06-12 11:43:34
阅读次数:
123
var i = 2;
Number.prototype.valueOf = function() {
return i++;
};
var a = new Number( 42 );
if (a == 2 && a == 3) {
console.log( "Yep, this happened." );
}
============================
"0...
分类:
编程语言 时间:
2015-06-12 10:11:08
阅读次数:
129