码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
python 函数
>>> def power(x): ... return x*x ... >>> power(5) 25 >>> def power(x,n): ... s=1 ... while n >0: ... n = n -1 ... s = s*x ... return s ... >>> power(5,2) 25 >>> power(5,3) 125...
分类:编程语言   时间:2015-07-09 15:00:54    阅读次数:162
[LeetCode][Java] 3Sum Closest
题目: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would h...
分类:编程语言   时间:2015-07-09 14:40:16    阅读次数:111
【LeetCode 144_二叉树_遍历】Binary Tree Preorder Traversal
解法一:非递归 1 vector preorderTraversal(TreeNode* root) 2 { 3 vector res; 4 if (root == NULL) 5 return res; 6 7 stack node_stack; 8 ...
分类:其他好文   时间:2015-07-09 13:09:15    阅读次数:103
LeetCode之“树”:Binary Tree Preorder Traversal && Binary Tree Inorder Traversal && Binary Tree Postorder Traversal
Binary Tree Preorder Traversal 题目链接 题目要求: Given a binary tree, return thepreordertraversal of its nodes' values. For example: Given binary tree{1...
分类:其他好文   时间:2015-07-09 13:04:42    阅读次数:91
C# Programming Study #1
引用的时候需要在参数和使用的时候加上 ref 关键字 static bool addnum (ref int val) //引用 { ++val; return true; }参数数组的概念,可以接受该类型的...
分类:Windows程序   时间:2015-07-09 12:59:45    阅读次数:196
C#的Lambda 表达式都使用 Lambda 运算符 =>,该运算符读为“goes to”。语法如下:
形参列表=>函数体函数体多于一条语句的可用大括号括起。类型可以将此表达式分配给委托类型,如下所示:delegate int del(int i);del myDelegate = x=>{return x*x;};int j = myDelegate(5);//j=25创建表达式目录树类型:usin...
分类:Windows程序   时间:2015-07-09 12:58:31    阅读次数:195
【LeetCode】221. Maximal Square
Maximal SquareGiven a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the ...
分类:其他好文   时间:2015-07-09 12:41:13    阅读次数:103
this的应用
//给人定义一个功能,用来判断是否是同龄人; class Person { private int age; private String name; Person(int age) { this.age=age; } public boolean compare(Person p) { return this.age==p.age;//!...
分类:其他好文   时间:2015-07-09 11:23:15    阅读次数:106
LeetCode145 Binary Tree Postorder Traversal Java题解(递归 迭代)
题目: Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [3,2,1]. 解题: 递归的还是和前面中...
分类:编程语言   时间:2015-07-09 11:16:06    阅读次数:179
phpcms V9 改造:输出sql语句
1、修改数据库驱动phpcms/libs/classes/mysql.class.php添加以下代码:/***最近一次查询语句*/private$lastquerysql='';publicfunctionlastsql(){return$this->lastquerysql;}修改execute方...
分类:数据库   时间:2015-07-09 11:05:05    阅读次数:161
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!