码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
以c++的方式实现单链表
之前用c语言的方式实现过单链表,现在用c++的方式实现单链表。以c++的类实现单链表,写完代码有了许多不一样的体会。感受到了两种语言的差异。#include<iostream> usingnamespacestd; classSlist { private: structNode { intdata; Node*pNext; }; intsize; N..
分类:编程语言   时间:2016-04-08 01:04:38    阅读次数:145
C# 使用正则表达式去掉字符串中的数字,或者去掉字符串中的非数字
/// 去掉字符串中的数字 public static string RemoveNumber(string key) { return Regex.Replace(key, @"\d", ""); } //去掉字符串中的非数字public static string RemoveNotNumber ...
分类:Windows程序   时间:2016-04-08 00:45:44    阅读次数:224
1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex ...
分类:其他好文   时间:2016-04-08 00:35:32    阅读次数:198
C语言的知识与能力予以自评
看到一个问卷不错,拟作为第三次作业的部分内容. int main(void){printf("hello .\n");printf("hello world.\n");return 0;}如果这个程序在第一个printf语句后设置断点就只输出hello,如果在第二个printf语句后设置断点,则两个 ...
分类:编程语言   时间:2016-04-07 20:56:31    阅读次数:293
页面静态化
控制器: //页面静态化(缓存) public function behaviors() { return [ [ 'class' => 'yii\filters\PageCache', 'only' => ['list'], 'duration' => 60, 'variations' => [ ...
分类:其他好文   时间:2016-04-07 20:37:07    阅读次数:121
R语言笔记 自定义峰度 和 偏度 函数
>mtcars<-function(x,na.omit=FALSE){+if(na.omit)+x<-x[!is.na(x)]+m<-mean(x)+n<-length(x)+s<-sd(x)+skew<-sum((x-m)^3/s^3)/n+kurt<-sum((x-m)^4/s^4)/n-3+return(c(n=n,mean=m,stdev=s,skew=skew,kurtosis=kurt))+}vars<-c("mpg","hp","wt")&g..
分类:编程语言   时间:2016-04-07 19:03:58    阅读次数:1279
98. Validate Binary Search Tree
Givenabinarytree,determineifitisavalidbinarysearchtree(BST).AssumeaBSTisdefinedasfollows:Theleftsubtreeofanodecontainsonlynodeswithkeyslessthanthenode‘skey.Therightsubtreeofanodecontainsonlynodeswithkeysgreaterthanthenode‘skey.Boththeleftandrightsubtreesmus..
分类:其他好文   时间:2016-04-07 18:53:25    阅读次数:212
LintCode-丢失的第一个正整数
题目描述: 给出一个无序的正数数组,找出其中没有出现的最小正整数。 样例 如果给出 [1,2,0], return 3 如果给出 [3,4,-1,1], return 2 如果给出 [1,2,0], return 3 如果给出 [3,4,-1,1], return 2 如果给出 [1,2,0], r ...
分类:其他好文   时间:2016-04-07 18:22:53    阅读次数:210
lintcode-medium-Unique Binary Search Trees II
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. Example Given n = 3, your program should return all 5 u ...
分类:其他好文   时间:2016-04-07 13:23:58    阅读次数:130
lintcode-medium-Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two n ...
分类:其他好文   时间:2016-04-07 13:18:14    阅读次数:108
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!