向量(vector) 连续存储的元素Vectorc;c.back() 传回最后一个数据,不检查这个数据是否存在。c.clear() 移除容器中所有数据。c.empty() 判断容器是否为空。c.front() 传回地一个数据。c.pop_back() 删除最后一个数据。c.push_back(ele...
分类:
其他好文 时间:
2014-09-24 00:23:15
阅读次数:
282
问题描述:
Programming Assignment 2: Randomized Queues and Deques
Write a generic data type for a deque and a randomized queue. The goal of this assignment is to implement elementary data structures ...
分类:
其他好文 时间:
2014-09-22 23:40:03
阅读次数:
406
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
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the ...
分类:
其他好文 时间:
2014-09-21 07:23:30
阅读次数:
370
Compare methodEither you implement a compare-method for your object:- (NSComparisonResult)compare:(Person *)otherObject { return [self.birthDate co...
分类:
其他好文 时间:
2014-09-20 23:09:39
阅读次数:
263
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