码迷,mamicode.com
首页 >  
搜索关键字:python实现    ( 3105个结果
leetcode 【 Find Minimum in Rotated Sorted Array 】python 实现
题目:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.Yo...
分类:编程语言   时间:2015-01-30 01:18:23    阅读次数:310
leetcode 【 Search for a Range 】python 实现
题目:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ...
分类:编程语言   时间:2015-01-30 01:16:29    阅读次数:200
leetcode 【Search a 2D Matrix 】python 实现
题目:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted fro...
分类:编程语言   时间:2015-01-30 00:00:31    阅读次数:368
Haffman Code
Haffman Code 什么是Haffman编码?以后再说,嘿嘿先上实现。 Python 实现: 在这个实现当中,我们并没有统计文本的字符出现频率,仅仅是为Haffman Coding的一个demo. """ Code writer : EOF Code file : haffman.py Code date : 2015.01.28 e-mail ...
分类:其他好文   时间:2015-01-28 14:38:43    阅读次数:145
leetcode 【 Search in Rotated Sorted Array II 】python 实现
题目:与上一道题几乎相同;不同之处在于array中允许有重复元素;但题目要求也简单了,只要返回true or falsehttp://www.cnblogs.com/xbf9xbf/p/4254590.html代码:oj测试通过Runtime:73 ms 1 class Solution: 2 .....
分类:编程语言   时间:2015-01-28 00:56:28    阅读次数:145
Python实现合并排序MergeSort
Python 合并函数
分类:编程语言   时间:2015-01-28 00:52:56    阅读次数:209
leetcode 【 Search in Rotated Sorted Array 】python 实现
题目:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).You are given a target valu...
分类:编程语言   时间:2015-01-27 23:29:46    阅读次数:256
Python实现Const
Python实现constPython实现constpython语言本身没有提供const,但实际开发中经常会遇到需要使用const的情形,由于语言本身没有这种支出,因此需要使用一些技巧来实现这一功能定义const类如下import sysclass Const(object): class ...
分类:编程语言   时间:2015-01-27 13:16:24    阅读次数:201
算法导论之python实现插入排序
插入排序 python 实现
分类:编程语言   时间:2015-01-27 01:46:39    阅读次数:222
leetcode 【 Trapping Rain Water 】python 实现
题目:Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining...
分类:移动开发   时间:2015-01-27 00:08:51    阅读次数:185
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!