huffman是非常基础的压缩算法。实现霍夫曼树的方式有很多种,可以使用优先队列(Priority Queue)简单达成这个过程,给与权重较低的符号较高的优先级(Priority),算法如下:⒈把n个终端节点加入优先队列,则n个节点都有一个优先权Pi,1 ≤ i ≤ n⒉如果队列内的节点数>1,则:...
分类:
其他好文 时间:
2014-09-22 21:20:23
阅读次数:
225
Dispatch Queues dispatch queues 是基于c机制的一系列自定义任务操作。遵循先进先出的规则。每次只执行一个任务,直到上个任务完成才执行新的任务。相反的,并发的dispatch queue可以启动多个任务而不用等待其他任务执行完成。提交给dispatch queue的任务必...
分类:
移动开发 时间:
2014-09-22 18:19:52
阅读次数:
156
算法网上很多,这里只是我手写的可执行的代码,备份用。#include<iostream>
#include<vector>
#include<queue>
usingnamespacestd;
structnode{
charelement;
structnode*left;
structnode*right;
//structnode*parent;
node(chara){
element=a;
}..
分类:
其他好文 时间:
2014-09-22 12:28:43
阅读次数:
229
1.stack的LinkList实现。
2.stack的数组实现
3.stack的可变数组实现
4.Queue的LinkList实现
5.Queue的可变数组实现思路...
分类:
其他好文 时间:
2014-09-21 23:24:11
阅读次数:
313
1、JMS是一个由AS提供的Message服务。它能接受消息产生者(Message Provider)所发出的消息,并把消息转发给消息消费者(Message Consumer)。2、JMS提供2种类型的消息服务:(1)Queue,即点对点,每一个消息仅仅转发给一个消息消费者使用。(2)Topic,即...
分类:
其他好文 时间:
2014-09-20 20:34:19
阅读次数:
259
bfs问题。
题意是说爬楼梯的时候,有些楼梯是 “ | ”,有些是“ - ”。而且每隔一分钟就互相变化形态。
“ | ”只能上下,“ - ”只能左右。
爬楼梯的过程中,会变的楼梯不能停留,其他的可以停留。
爬楼梯需要一个单位时间,假如是“ - ”表明一个单位时间从它左边到它右边或者 右边到左边。
楼梯停留多次没有意义,特殊楼梯只有2种旋转状态,多一个wait[][] 检查就可以。...
分类:
其他好文 时间:
2014-09-20 20:32:59
阅读次数:
173
BFS (Bridth First Search) can be implemented by a queue.Procedure is like this: (Q is Queue)1, Put 1 in Q : ->1 (front) 2, Read the front of Q (which ...
分类:
其他好文 时间:
2014-09-20 04:36:36
阅读次数:
237
http://zeromq.orgZeroMQ\zero-em-queue\, \ØMQ\:?Ø Connect your code in any language, on any platform.?Ø Carries messages across inproc, IPC, TCP, TPI.....
分类:
其他好文 时间:
2014-09-19 22:23:46
阅读次数:
190
http://rdoc.info/github/ruby-amqp/bunny/Bunny/QueueClass: Bunny::QueueInherits:Object show all Defined in:lib/bunny/queue.rbOverviewRepresents AMQP 0....
分类:
其他好文 时间:
2014-09-19 19:12:45
阅读次数:
455
本来想用 priority_queue 去写个bfs。结果重载运算符忘了。ORZ。
然后看书和问别人熟悉了一下,记录一下。
struct lx
{
int x,y,lv;
};
有一个这样的结构体。x,y,是坐标,lv 是它的权。重载
struct lx
{
int x,y,lv;
friend bool operator<(lx a,lx b)
...
分类:
编程语言 时间:
2014-09-19 12:01:05
阅读次数:
236