Huffman Encode 哈弗曼编码(python实现)

摘要: # coding: utf-8#Tree-Node Typeclass Node: def __init__(self,freq): self.left = None self.right = None self.father = None ... 阅读全文
posted @ 2015-09-04 16:55 conard 阅读(1001) 评论(0) 推荐(0) 编辑

关于python中的 object基类

摘要: In [1]:class Foo(object): passclass Foo1(): passclass Foo2: pass In [2]:type(Foo),type(Foo1),type(Foo2)Out[2]:(type, classobj, classobj)In... 阅读全文
posted @ 2015-09-02 22:49 conard 阅读(1170) 评论(0) 推荐(0) 编辑

Python tips

摘要: 1、xrange 2、int自动转换为long 注:Python里的长整型所能表达的范围远远超过C语言中的长整型,事实上,Python长整型仅受限于用户计算机的虚拟内存,类似于java中的BigInter类型,从Python2.3开始,不存在报整型溢出错误,结果会自动转换为长整型。 3、删除列表中的 阅读全文
posted @ 2015-09-02 15:45 conard 阅读(192) 评论(0) 推荐(0) 编辑