本文整理汇总了C++中ArrayQueue::Test方法的典型用法代码示例。如果您正苦于以下问题:C++ ArrayQueue::Test方法的具体用法?C++ ArrayQueue::Test怎么用?C++ ArrayQueue::Test使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayQueue
的用法示例。
在下文中一共展示了ArrayQueue::Test方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowDataStructItems
void Display::ShowDataStructItems()
{
ArrayStack<int> dsArrayStack;
ListStack<int> lsListStack;
ArrayQueue<int> aqArrayQueue;
CycleDoublyLinkList<int> dcllCycleDoublyLinkList;
BinarySearchTree<int> bstBinarySearchTree;
RedBlackTree<int> rbtRedBlackTree;
MergeFindSet<int> mfsMergeFindSet;
HashTable<int> htHashTable;
cout<<WELCOME_STRING<<endl;
cout<<"This is the Implement of Data Structs"<<endl;
cout<<"Please Select the Item you are Interest in:"<<endl;
cout<<"1. Stack(Implement of Array);"<<endl;
cout<<"2. Stack(Implement of List);"<<endl;
cout<<"3. Queue(Implement of Array);"<<endl;
cout<<"4. Cycle Doubly Linked List"<<endl;
cout<<"5. Binary Search Tree"<<endl;
cout<<"6. Red Black Tree"<<endl;
cout<<"7. Merge Find Set"<<endl;
cout<<"8. Hash Table"<<endl;
cout<<"98. Up Layer;"<<endl;
cout<<"99. Quit."<<endl;
cout<<STAR_STRING<<endl;
cout<<endl;
int nSelect;
while(1)
{
cin>>nSelect;
if(cin.fail())
{
ClearScreen();
cout<<"Input Error! Please Select Again!"<<endl;
cin.clear();
cin.sync();
ShowDataStructItems();
}
ClearScreen();
switch(nSelect)
{
case 1:
cout<<dsArrayStack.GetTitle().c_str()<<endl;
dsArrayStack.Description();
dsArrayStack.Test();
ShowDataStructItems();
break;
case 2:
cout<<lsListStack.GetTitle().c_str()<<endl;
lsListStack.Description();
lsListStack.Test();
ShowDataStructItems();
break;
case 3:
cout<<aqArrayQueue.GetTitle().c_str()<<endl;
aqArrayQueue.Description();
aqArrayQueue.Test();
ShowDataStructItems();
break;
case 4:
cout<<dcllCycleDoublyLinkList.GetTitle().c_str()<<endl;
dcllCycleDoublyLinkList.Description();
dcllCycleDoublyLinkList.Test();
ShowDataStructItems();
break;
case 5:
cout<<bstBinarySearchTree.GetTitle().c_str()<<endl;
bstBinarySearchTree.Description();
bstBinarySearchTree.Test();
ShowDataStructItems();
break;
case 6:
cout<<rbtRedBlackTree.GetTitle().c_str()<<endl;
rbtRedBlackTree.Description();
rbtRedBlackTree.Test();
ShowDataStructItems();
break;
case 7:
cout<<mfsMergeFindSet.GetTitle().c_str()<<endl;
mfsMergeFindSet.Description();
mfsMergeFindSet.Test();
ShowDataStructItems();
break;
case 8:
cout<<htHashTable.GetTitle().c_str()<<endl;
htHashTable.Description();
htHashTable.Test();
ShowDataStructItems();
break;
case 98:
goto ShowWelcome;
break;
case 99:
exit(0);
break;
default:
ClearScreen();
cout<<"Select Error! Please Select Again!"<<endl;
cin.clear();
cin.sync();
ShowDataStructItems();
//.........这里部分代码省略.........