Description
Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…
The Lunar New Year was approaching, but unluckily the Little ...
分类:
其他好文 时间:
2014-10-05 01:33:37
阅读次数:
349
跟上篇实现stack的思路一致,我增加了一些成员函数模板,支持不同类型的Queue之间的复制和赋值。 同时提供一个异常类。 代码如下: #ifndef QUEUE_HPP
#define QUEUE_HPP #include "Exception.h"
#include class EmptyQue...
分类:
其他好文 时间:
2014-10-04 22:27:07
阅读次数:
228
1.定义比较函数,以函数对象形式
这种方式使用时,需要把函数加入priority_queue的声明中去
struct com{
bool operator()( T &t1, T &t2)
{
}
};
priority_queue, com> que;
2.在结构体中重载
class T{
public:
friend bool o...
分类:
编程语言 时间:
2014-10-03 16:40:34
阅读次数:
292
判断CPU瓶颈1, %processor time 平均值大于952, processor queue length大于2 (大于处理器个数+1).可以确定CPU瓶颈3, CPU空闲时间为零(zero percent idle CPU)4, 过高的用户占用CPU时间(%User Time)5, 过高...
分类:
其他好文 时间:
2014-10-03 13:23:14
阅读次数:
171
【泛型可迭代的基础集合数据类型的API】背包:就是一种不支持从中删除元素的集合数据类型——它的目的就是帮助用例收集元素并迭代遍历所有收集到的元素。(用例也可以检查背包是否为空, 或者获取背包中元素的数量) public class Bag implements Iterable Bag() 创建.....
本篇我们将实现Queue的简单操作;一、Queue版本1;通过本程序,我们可以看到 pop、push 、back、front、size的简单操作的实现;//Queue.hpp#ifndef QUEUE_H_#define QUEUE_H_#include template //默认的类型形参 >cl...
分类:
编程语言 时间:
2014-10-02 02:51:02
阅读次数:
315
package com.bjsxt.others.que; import java.util.ArrayDeque;
import java.util.Queue; /** * 使用队列模拟银行存款业务 * @author Administrator * */
public class Demo01...
分类:
其他好文 时间:
2014-10-02 01:57:32
阅读次数:
232
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4441题意:一个数列,三种操作:(1)插入:找到没在当前数列中的最小的正整数i,将其插在位置p之后,并将-i插入某个位置使得满足先进先出(i表示进,-i表示出),这个位置尽量靠右;(2)删除:删掉数字i以...
分类:
其他好文 时间:
2014-10-02 00:18:31
阅读次数:
259
按照本人对于容器制作的一些约定,容器仅仅提供运行环境,配置和数据保存在host中的某个约定位置。 rabbitmq的一个配置文件的位置固定的,必须放在指定位置,rabbitmq-env.conf。所以把它制作到容器中。 CONFIG_F...
分类:
其他好文 时间:
2014-09-30 12:07:01
阅读次数:
399
栈 stack 是一种先进后出的(First In Last Out, FILO)的数据结构。在 STL中,其底层容器默认使用的是 deque, 也可以自己指定用 vector 或 list容器,然后将其接口适配为栈的接口。队列 queue 是一种先进先出(First In First Out, FIFO)的数据结构。在 STL 中,其底层容器默认使用的也是 deque,也可以自己指定用 vector 或 list容器,然后将其接口适配为队列的接口。优先级队列 priority_queue 是一种允许用户以...
分类:
其他好文 时间:
2014-09-29 20:25:01
阅读次数:
230