Chinaunix首页 | 论坛 | 博客
  • 博客访问: 735590
  • 博文数量: 769
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 4985
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-15 16:37
文章分类

全部博文(769)

文章存档

2011年(1)

2008年(768)

我的朋友

分类:

2008-10-15 16:41:05

 #ifndef StackTest_H
  #define StackTest_H
  #include "Stack.h"
  void StackTest_int()
  {
  cout << endl << "整型栈" << endl;
  cout << endl << "构造一个空栈" << endl;
  Stack a;
  cout << "将1~20入栈,然后再出栈" << endl;
  for (int i = 1; i <= 20; i++) a.Push(i);
  while (!a.IsEmpty()) cout << a.Pop() << ' ';
  cout << endl;
  }
  #endif
  #ifndef QueueTest_H
  #define QueueTest_H
  #include "Queue.h"
  void QueueTest_int()
  {
  cout << endl << "整型队列测试" << endl;
  cout << endl << "构造一个空队列" << endl;
  Queue a;
  cout << "将1~20入队,然后再出队" << endl;
  for (int i = 1; i <= 20; i++) a.EnQueue(i);
  while (!a.IsEmpty()) cout << a.DeQueue() << ' ';
  cout << endl;
  }
  #endif
--------------------next---------------------

阅读(334) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~