deque.cpp
来自「常用算法与数据结构原代码」· C++ 代码 · 共 25 行
CPP
25 行
#include<iostream.h>
#include "deque.h"
void main(void)
{
Deque<int> Q(3);
Q.AddLeft(2).AddLeft(1).AddRight(3);
cout << "The deque from front to rear is"
<< endl
<< Q << endl;
int x;
Q.DeleteRight(x);
cout << x << " deleted from rear" << endl;
Q.AddLeft(4).DeleteRight(x);
cout << Q.Left() << " added to front and "
<< x << " deleted from rear" << endl;
Q.DeleteLeft(x);
cout << x << " deleted from front" << endl;
Q.DeleteLeft(x);
cout << x << " deleted from front" << endl;
cout << "The deque from front to rear is"
<< endl
<< Q << endl;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?