题目: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
题目: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
题目: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编码?以后再说,嘿嘿先上实现。
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
题目:与上一道题几乎相同;不同之处在于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
题目: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实现constPython实现constpython语言本身没有提供const,但实际开发中经常会遇到需要使用const的情形,由于语言本身没有这种支出,因此需要使用一些技巧来实现这一功能定义const类如下import sysclass Const(object): class ...
分类:
编程语言 时间:
2015-01-27 13:16:24
阅读次数:
201
题目: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