go 语言中的结构体方法结构体名称的大小写有着不同的意义: 小写表示不能被别的包访问package mainimport "fmt"type Rect struct { width,height int}func (r *Rect) area() int { return r.width*r.hei...
分类:
编程语言 时间:
2015-07-10 12:53:15
阅读次数:
141
赫夫曼树的应用
1、哈夫曼编码
在数据通信中,需要将传送的文字转换成二进制的字符串,用0,1码的不同排列来表示字符。例如,需传送的报文为“AFTER DATA EAR ARE ART AREA”,这里用到的字符集为“A,E,R,T,F,D”,各字母出现的次数为{8,4,5,3,1,1}。现要求为这些字母设计编码。要区别6个字母,最简单的二进制编码方式是等长编码,固定采用3位二进制,可分别用0...
分类:
其他好文 时间:
2015-07-09 19:56:25
阅读次数:
312
Maximal SquareGiven a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the ...
分类:
其他好文 时间:
2015-07-09 12:41:13
阅读次数:
103
$('#addbtn').on('click',function(){ $('#assist_area').show().animate({height:'170px'},300,function(){ $('#....').show(); });});选择器换成你自己的就行了
分类:
其他好文 时间:
2015-07-09 11:08:19
阅读次数:
89
JVM框架Java虚拟机HotSpot的框架:JVM主要组成部分:Class Loader(类加载器)、Runtime Data Area(运行时数据区)、执行引擎(Execution Engine)。JVM垃圾回收简介Step1:MarkingGC算法在扫描存活对象时通常需要从Root节点开始,扫...
分类:
编程语言 时间:
2015-07-09 00:19:50
阅读次数:
242
Maximal RectangleGiven a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.一道超难的题目,思想难,同时实现...
分类:
其他好文 时间:
2015-07-08 14:34:30
阅读次数:
156
Find the total area covered by two rectilinear rectangles in a 2D plane.
Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.
Assume that the tota...
分类:
其他好文 时间:
2015-07-08 09:33:41
阅读次数:
138
思路简单 找寻重复面积, 重点是找到重复矩形的长和宽(有可能没有覆盖即为0, 这一点要注意) 代码如下class Solution: def computeArea(self, A, B, C, D, E, F, G, H): areaA = (C - A) * (D - B) ...
分类:
其他好文 时间:
2015-07-07 07:02:05
阅读次数:
161
1、代码2、运行1、代码 1 package main 2 3 import "fmt" 4 5 type Rect struct { 6 x, y float64 7 width, height float64 8 } 9 10 func (r * Rect) Area() f...
分类:
编程语言 时间:
2015-07-06 22:59:48
阅读次数:
180
问题:在django的models.py 在。我们定义一些choices元组,类别似一些字典值。通常下拉框或单个复选框,例如 0相应的M 1妇女和其他有关class Area(models.Model): Area_Level = ( (0, u'全国'), (...
分类:
其他好文 时间:
2015-07-06 11:48:38
阅读次数:
139