码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
LeetCode Remove Nth Node From End of List
class Solution {public: ListNode *removeNthFromEnd(ListNode *head, int n) { if (head == NULL) return NULL; ListNode* pre = NULL; ...
分类:其他好文   时间:2014-07-18 18:24:55    阅读次数:209
js日期处理类(网上收集)
/***日期处理工具类*/varDateUtil=function(){/***判断闰年*@paramdateDate日期对象*@returnbooleantrue或false*/this.isLeapYear=function(date){return(0==date.getYear()%4&&(...
分类:Web程序   时间:2014-07-18 17:26:22    阅读次数:335
简单插入排序
直接插入排序是一种最简单的排序方式,它的基本操作是将一个记录插入已排好序的有序表中,从而得到一个新的、记录数增1的有序表。时间复杂度为O(n^2),跟冒泡、选择一样。 核心代码: //按非降序排列 void Insert_Sort(int arr[],int len) { if(arr == NULL || len <= 0) { return; } int i,j,t...
分类:其他好文   时间:2014-07-18 15:11:24    阅读次数:254
【leetcode刷题笔记】N-Queens
Then-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all distinc...
分类:其他好文   时间:2014-07-18 15:07:26    阅读次数:223
yii2表关联实例
yii2表关联例如:商品表关联品牌表在控制器中:$goods_info=$goods_model::find()->joinWith('brand')->all();模型中://关联品牌表 public function getbrand(){ return $this->hasMany(Bran....
分类:其他好文   时间:2014-07-18 14:14:05    阅读次数:204
yii2中表单的字段标签名称
1.以登陆页面为例,默认是英文的,在loginForm.php中添加attributeLabels,可以变成中文具体代码如下:public function attributeLabels(){ return array( 'username'=>'用户名:', 'password'=>'...
分类:其他好文   时间:2014-07-18 13:31:03    阅读次数:207
[C++程序设计]用数组名作函数参数
1. 用数组元素作函数实参 1 #include 2 using namespace std; 3 4 int max_value(int x, int max) 5 { 6 return max > x ? max : x; 7 } 8 9 int main()10 {11 ...
分类:编程语言   时间:2014-07-18 12:24:41    阅读次数:241
javascript函数的声明,及返回值
//因为javascript是弱类型的语言,所以参数不需要加类型。函数的也不需要像c#那样要求所以路径都需要有返回值(这个不像c#语言,而且c#的方法也不需要在方法名前面在 function关键字) function add(i, j) { //现在只是声明了一个函数在这里,只有调用到它的时候它才会被执行。 return i + j;...
分类:编程语言   时间:2014-07-18 12:18:25    阅读次数:182
[LeetCode] Palindrome Partitioning
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv...
分类:其他好文   时间:2014-07-18 12:12:12    阅读次数:222
yii2验证码的使用
1.控制器中public function actions() { return [ 'captcha' => [ 'class' => 'yii\captcha\CaptchaAction', 'fixedVerifyCode' => YII_ENV_...
分类:其他好文   时间:2014-07-18 11:36:01    阅读次数:257
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!