码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
java日期工具类
这里我总结了java中日期的处理方法   /** * 按照yyyy-MM-dd HH:mm:ss格式化日期 * 可根据需要定制 * @param date * @return */ public static String format(Date date) { sdf.applyPattern("yyyy-MM-dd HH:mm:ss"); return s...
分类:编程语言   时间:2014-07-06 12:08:24    阅读次数:236
[leetcode] Insertion Sort List(python)
简单的插入排序,总是超时,暂且放在这记录一下。 class Solution: # @param head, a ListNode # @return a ListNode def insertionSortList(self, head): if head == None or head.next == None: return head psuhead...
分类:编程语言   时间:2014-07-06 11:52:20    阅读次数:230
HDU 1272 小希的迷宫
并查集的应用。 实质上是判断这是否是一棵树。 需要注意的是0 0 也是一棵树。 #include #include #include using namespace std; int a[100001],n; int vis[100001]; int fa(int x) { if(x!=a[x]) return a[x]=fa(a[x]); } int main(...
分类:其他好文   时间:2014-07-06 10:39:50    阅读次数:164
Android解析获取网络上的图片(支持bmp格式)
Android学习系列 - 显示网络上的图片(支持bmp格式))   见如下代码:   /**     * 到Url地址上去下载图片,并回传Bitmap回來     *     * @param imgUrl * @return          */  public static Bitmap getBitmapFromUrl(String imgUrl) { ...
分类:移动开发   时间:2014-07-06 09:44:03    阅读次数:233
【剑指offer】Q5:从尾到头打印链表
可以练习下链表的逆置。 def PrintListReversingly(head): if head == None: return if head: PrintListReversingly(head.next) print head.val def reverse(head): if head == None or head.next == None: return...
分类:其他好文   时间:2014-07-06 09:29:57    阅读次数:214
【leetcode】sort list(python)
链表的归并排序 超时的代码 class Solution: def merge(self, head1, head2): if head1 == None: return head2 if head2 == None: return head1 # head1 and head2 point to the same link list if head1 == he...
分类:编程语言   时间:2014-07-06 09:09:51    阅读次数:275
【leetcode】Reverse Words in a String (python)
陆陆续续几个月下来,终于把题刷完了,过程中遇到的python的题解很少,这里重新用python实现下,所以题解可能都是总结性的,或者是新的心得,不会仅针对题目本身说的太详细。 def reverseWords(self, s): s = ' '.join(s.split()[::-1]) return s [ : :  -1 ] 是将元素进行翻转...
分类:编程语言   时间:2014-07-06 00:37:50    阅读次数:299
java中IO写文件工具类
/** * 获取路径文件夹下的所有文件 * @param path * @return */ public static File[] getKeywordFiles(String path) { File dir = new File(path); if (!dir.exists()) return null; File[] fs = dir.listFile...
分类:编程语言   时间:2014-07-05 23:31:41    阅读次数:192
LeetCode:Combinations
Given two integers n and k, return all possible combinations of k numbers out of 1 ...n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4...
分类:其他好文   时间:2014-07-05 22:10:53    阅读次数:226
Deffered.js的实现原理
1 function Deferred () { 2 return this.init(); 3 }//设置默认的成功函数与失败函数 4 Deferred.ok = function(x) {return x} 5 Deferred.ng = function(x) {throw x} 6 D...
分类:Web程序   时间:2014-07-05 20:50:56    阅读次数:291
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!