码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
Leetcode: Remove Duplicates from Sorted Array
称号: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate ex...
分类:其他好文   时间:2015-08-08 14:49:28    阅读次数:112
LeetCode(67)题解: Add Binary
https://leetcode.com/problems/add-binary/题目:Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".思路:...
分类:其他好文   时间:2015-08-08 13:33:55    阅读次数:83
Minimum Size Subarray Sum -- leetcode
Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 0 instead. For example, given the array [2,3...
分类:其他好文   时间:2015-08-08 12:11:52    阅读次数:168
C++面向对象--类
1、实例化的两种方式 #include  #include   using namespace std;   class lio { public:     int a=3;     int b=4;     void aa()     {         cout     }     int bb()     {         return b;     }...
分类:编程语言   时间:2015-08-08 12:08:17    阅读次数:180
c++ stl string做接口函数应该注意到的
请看下面代码string AddString(const string& a,const string & b){ return a + b;}int _tmain(int argc, _TCHAR* argv[]){ const char * szA = "Zhang"; con...
分类:编程语言   时间:2015-08-08 12:03:30    阅读次数:196
堆以及优先队列
#includeusing namespace std;int A[]={0,4,1,3,2,16,9,10,14,8,7};int left(int i){ return 2*i;}int right(int i){ return 2*i+1;}int parent(int i){ ...
分类:其他好文   时间:2015-08-08 11:50:24    阅读次数:128
jquery封装插件
1.封装静态插件 创建一个jquery文件 里面可以封装多个方法 命名格式多位 jquery.[插件名].js$.extend({ add:function(a,b){return a+b;}});$.extend({ mins:function(a,b){return a-b;}});2.封装.....
分类:Web程序   时间:2015-08-08 11:48:55    阅读次数:152
《算法导论》——数论
1 . 欧几里得算法(递归法球两个数的最大公约数) 算法比较简单就直接贴代码了: int gcd(int a , int b){ return b ==0 ? a : gcd(b , a%b); } 在这个算法的基础上可以该进,gcd(a*n , ...
分类:编程语言   时间:2015-08-08 11:47:15    阅读次数:137
Reverse Integer
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321注意考虑几个情况,x=1534236460 1534236469 -2147483647等等。写的代码有点冗长了。 1 pub...
分类:其他好文   时间:2015-08-08 11:45:33    阅读次数:118
【LeetCode-面试算法经典-Java实现】【103-Binary Tree Zigzag Level Order Traversal(二叉树分层Z字形遍历)】
【103-Binary Tree Zigzag Level Order Traversal(二叉树分层Z字形遍历)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题  Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to righ...
分类:编程语言   时间:2015-08-08 07:58:56    阅读次数:182
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!