码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
[leedcode 132] Palindrome Partitioning II
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs...
分类:其他好文   时间:2015-07-26 15:25:58    阅读次数:128
[leedcode 131] Palindrome Partitioning
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv...
分类:其他好文   时间:2015-07-26 15:24:54    阅读次数:98
leetcode:Factorial Trailing Zeroes
Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.分析:题意即为 阶乘尾部的零(求n!中尾部为0的个数)思路...
分类:其他好文   时间:2015-07-26 14:03:17    阅读次数:109
欧几里得算法的递归写法
在看《数论》是看到欧几里得算法可以这样写,脑洞大开。1 int Gcd(int a,int b)2 {3 if(b==0) 4 return a;//出口5 return Gcd(b,a%b);6 7 }
分类:编程语言   时间:2015-07-26 13:56:47    阅读次数:145
JSP之Model1
package com.po; public class Users { private String username; private String password; public Users(){ } public String getUsername() { return username; } public void setUsername(Strin...
分类:Web程序   时间:2015-07-26 11:14:40    阅读次数:201
Swift:Extension和Protocol
一、Swift中的扩展功能(Extension)可以动态给类增加功能,类似于Javascript中的prototype; 而在objective-c中,是通过runtime来实现动态调用或者添加功能的。 定义方式如下: extension SomeType { } 1. 单位转换 extension Double { var km: Double {return self * ...
分类:编程语言   时间:2015-07-26 09:51:27    阅读次数:415
JSP之JavaBean
package com.po; public class Users { private String username; private String password; public Users(){ } public String getUsername() { return username; } public void setUsername(String us...
分类:编程语言   时间:2015-07-26 00:29:48    阅读次数:143
Python - 字典(dict)删除元素
字典(dict)删除元素, 可以选择两种方式, dict.pop(key)和del dict[key].代码# -*- coding: utf-8 -*- def remove_key(d, key): r = dict(d) del r[key] return r x = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0} x.pop(1) print xx =...
分类:编程语言   时间:2015-07-25 23:04:27    阅读次数:163
使用递归和非递归求f(m,n)
递归方法如下: int f(int m, int n) { if (1 == m) { return n; } else if (1 == n) { return m; } return f(m, n - 1) + f(m - 1, n); } 非递归方法如下: int f(int m, int n) { int a[100][100]; for ...
分类:其他好文   时间:2015-07-25 23:02:26    阅读次数:226
[leetcode]Subsets
问题叙述性说明:Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set mu...
分类:其他好文   时间:2015-07-25 21:33:08    阅读次数:124
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!