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-07-05 22:29:21
阅读次数:
151
函数模板特template int compare(T v1,T v2){if(v1v2) return 1;else return 0;}template int compare(char * s1,char * s2){ return strcmp(s1,s2);}类模板的特化templa...
分类:
编程语言 时间:
2015-07-05 21:04:47
阅读次数:
153
#include
int compare(int a,int b)
{
return a - b;
}
void sort(int *a,int n,int(*p)(int,int))
{
int i,j;
/*
for(i=0;i<n-1;i++)
{
for(j=0;j0)
{
int tem...
分类:
编程语言 时间:
2015-07-05 19:58:30
阅读次数:
136
#include
int compare(int a,int b)
{
return a - b;
}
void select_sort(int *a,int n,int(*p)(int,int))
{
int i,j;
for(i=0;i<n-1;i++)
{
for(j=i+1;j0)
{
int tem...
分类:
编程语言 时间:
2015-07-05 19:57:37
阅读次数:
144
controller cspublic ActionResult AdvanceSearchForm() { SearchCriteriaModel model = new SearchCriteriaModel { SearchInAll = true }; return PartialView(...
分类:
Web程序 时间:
2015-07-05 19:55:37
阅读次数:
230
解法一:递归 1 bool isSameTree(TreeNode* p, TreeNode* q) 2 { 3 if (p == NULL && q == NULL) 4 return true; 5 if ((p == NULL && q != NULL) || ...
分类:
其他好文 时间:
2015-07-05 19:55:23
阅读次数:
97
1. Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of ...
分类:
其他好文 时间:
2015-07-05 19:49:25
阅读次数:
93
Find the capitalsDescription:InstructionsWrite a function that takes a single string (word) as argument. The function must return an ordered list cont...
直接先看两段代码
function getSum() {
var sum = a + b;
var a = 1;
var b = 2;
return sum;
}
getSum();
function getSum() {
...
分类:
编程语言 时间:
2015-07-05 18:37:05
阅读次数:
135
解法一:递归1 int maxDepth(TreeNode* root)2 {3 if (root == NULL)4 return 0;5 6 int max_left_Depth = maxDepth(root->left);7 int max_right...
分类:
其他好文 时间:
2015-07-05 18:31:24
阅读次数:
101