测试队列的实例
来源:互联网 发布:部落冲突10本满防数据 编辑:程序博客网 时间:2024/06/07 09:03
/*_############################################################################
_##
_## 测试队列的实例
_## Author: xwlee
_## Time: 2006.12.31
_## Chang'an University
_## Development condition: win2003 Server+VC6.0
_##
_## temp.cpp 文件
_##########################################################################*/
#include<iostream>
#include <ctime>
#include <iomanip>
#include "stack.h"
using namespace std;
#define TEMP_SIZE 10
int main()
{
QUEUE_TYPE temp=100;
// int i;
myinsert( 40 );
myinsert( 50 );
myinsert( 60 );
myinsert( 70 );
myinsert( 80 );
cout << "is_full()=" << is_full() << endl;
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout<< "=======================================================" << endl;
myinsert( 140 );
myinsert( 150 );
myinsert( 160 );
myinsert( 170 );
myinsert( 180 );
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "is_empty()=" << is_empty() << endl;
cout << "is_full()=" << is_full() << endl;
/* srand( (unsigned)time( NULL ) ); // srand()函数产生一个以当前时间开始的随机种子.
for(i=0; i < TEMP_SIZE; i++)
myinsert( 1+i );
for(i=0; i < TEMP_SIZE; i++)
{
cout << setw(5) << first();
mydelete();
if( (i+1) % 10 == 0 )
cout << endl;
}
*/
cout<< "=======================================================" << endl;
cout << "is_empty()=" << is_empty() << endl;
cout << "is_full()=" << is_full() << endl;
return 0;
}
_##
_## 测试队列的实例
_## Author: xwlee
_## Time: 2006.12.31
_## Chang'an University
_## Development condition: win2003 Server+VC6.0
_##
_## temp.cpp 文件
_##########################################################################*/
#include<iostream>
#include <ctime>
#include <iomanip>
#include "stack.h"
using namespace std;
#define TEMP_SIZE 10
int main()
{
QUEUE_TYPE temp=100;
// int i;
myinsert( 40 );
myinsert( 50 );
myinsert( 60 );
myinsert( 70 );
myinsert( 80 );
cout << "is_full()=" << is_full() << endl;
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout<< "=======================================================" << endl;
myinsert( 140 );
myinsert( 150 );
myinsert( 160 );
myinsert( 170 );
myinsert( 180 );
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "first()=" << first() << endl;
mydelete();
cout << "is_empty()=" << is_empty() << endl;
cout << "is_full()=" << is_full() << endl;
/* srand( (unsigned)time( NULL ) ); // srand()函数产生一个以当前时间开始的随机种子.
for(i=0; i < TEMP_SIZE; i++)
myinsert( 1+i );
for(i=0; i < TEMP_SIZE; i++)
{
cout << setw(5) << first();
mydelete();
if( (i+1) % 10 == 0 )
cout << endl;
}
*/
cout<< "=======================================================" << endl;
cout << "is_empty()=" << is_empty() << endl;
cout << "is_full()=" << is_full() << endl;
return 0;
}
- 测试队列的实例
- 队列的实例
- 循环队列的测试
- 测试队列的长度
- 简单的消息队列实例
- 测试堆栈的实例
- 【多线程】 java线程实例(测试阻塞队列&&线程池)
- 并发队列ConcurrentLinkedQueue和阻塞队列LinkedBlockingQueue用的实例
- 消息队列MSMQ的使用实例
- .Net消息队列MSMQ的使用实例
- 消息队列MSMQ的使用实例
- 一个多线程和队列的实例演示
- 基于Weblogic8的JMS队列实例配置
- 基于Weblogic8的JMS队列实例配置
- 针对Redis队列的理解,实例操作
- 带结构体的队列 进出实例
- 跟着实例学习ZooKeeper的用法: 队列
- 数据结构(Java)——队列的实例
- C#下读取INI文件类
- 一文钱
- C#下字符串处理方法
- 一个队列模块的接口
- 静态数组实现的队列
- 测试队列的实例
- FTP配置
- 一个由CVS不区分大小导致的404问题
- 国内 ACM Online Judge 列表
- 从今起改投JAVA,c#不再是我的首选了,开源也许是个不错的选择
- linux
- 从Windows共享linux资源
- 一个asp采集程序类
- 设置列表框最小宽度且可随着内容变宽的方法