码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
Maximum Gap -- leetcode
Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 0 if the array contains less than 2 elements...
分类:其他好文   时间:2015-06-21 14:33:28    阅读次数:214
总结ASP.NET中用到的几种代码
在服务器端创建按钮添加对话框(可能用到的比较少,但是可以这么干)1 Button1.Attributes.Add("onclick","return confirm(’确认?’)"); 2 Button1.attributes.add("onclick","if(confirm(’are you ....
分类:Web程序   时间:2015-06-21 14:24:54    阅读次数:165
leetcode_16_3Sum Closest
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 thr...
分类:其他好文   时间:2015-06-21 13:13:56    阅读次数:114
C#入门学习之属性和方法
一 总结1 方法分为静态方法和非静态方法,静态方法不对特定的实例进行操作,且不允许引用this,非静态方法是对类的某个特定的实例进行操作,且可以用this来访改方法例子一 静态方法:public static int add(int x,int y){return x+y;}static void ...
分类:Windows程序   时间:2015-06-21 11:50:20    阅读次数:128
Leetcode 119 Pascal's Triangle II
Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].也可以和 Leetcode 118 Pascal's TriangleII 一样构造最后返回最后一行。v...
分类:其他好文   时间:2015-06-21 11:48:52    阅读次数:108
Find Peak Element -- leetcode
A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its index. The array may contain multiple peaks, i...
分类:其他好文   时间:2015-06-21 10:43:32    阅读次数:119
hash
#include int a[100000]; int Hashf(int x){ return x + 1; } int main() { int n; scanf("%d",&n); while(n--){ int x; scanf("%d",&x); int y = Hashf(x); a[y...
分类:其他好文   时间:2015-06-21 10:43:08    阅读次数:118
leetcode - Merge k Sorted Lists
题目: Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.  分析: 用multiset作为小根堆,multiset的begin是value最小的结点。 注意:...
分类:其他好文   时间:2015-06-21 10:42:17    阅读次数:127
二叉树的三种输出方式:递归、栈、循环
三种方法中,递归最为简单,栈次之,循环最为麻烦。递归的深度如果太大则会导致栈溢出;栈的方式需要额外的辅助空间;循环编程最麻烦。           首先是递归: //递归方法 void midPrint_r(TreeNode* root) {//中序遍历 if(root==NULL) return; if(root->left) midPrint(root->left); c...
分类:其他好文   时间:2015-06-21 10:39:45    阅读次数:109
Leetcode 118 Pascal's Triangle
GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]...
分类:其他好文   时间:2015-06-21 10:36:06    阅读次数:121
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!