亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? interface.cpp

?? 關于數據結構的相關內容,表達式樹,前中后序遍歷,哈夫曼編碼,線性表操作
?? CPP
字號:
#include "Interface.h"
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>

template<class DataType>
Interface<DataType>::Interface(void)
{
}

template<class DataType>
Interface<DataType>::~Interface(void)
{
}

template<class DataType>
void Interface<DataType>::GetLength(const Chain<DataType> &List) const			//取長度模塊
{
	cout<<"\nThe Length of the List is : " << List.Length() <<endl;			//直接將長度輸出
}

template<class DataType>
void Interface<DataType>::Output(Chain<DataType> &List)				//輸出模塊
{
		bool reselect;
		cout<<"\n\n*****Output Module***** ";
		cout<<"\n1.Output before sort. \n2.Output after sort. \n3.Return to mainmenu.\n4.Exit.\nselect an operation: \n";			//可以選擇的操作,原線性表輸出,按升序輸出,返回主菜單,退出程序
		char selection;			 //判斷是否要重呈現子菜單
		selection=getch();		//讀取對操作的選擇
		while(1)			//無限循環,對于不符合要求可以直接退出或者返回
		{
			reselect=true;
			switch(selection)
			{
			case '1':{
				Chain<DataType> temp(List);			//創建一個線性表,為了防止對原線性表的修改,便于用戶進行其他的操作
				try
				{
					cout<<temp;
				}
				catch(Error)			//如果拋出異常就捕捉,輸出錯誤提示信息
				{
					cout<<"\nPlease check the data input or input the data again.\n";
					break;
				}
				break;}
			case '2':{
				Chain<DataType> temp(List);
				try
				{
					temp.Sort();
					cout<<temp;
				}
				catch(Error)
				{
					cout<<"\nPlease check the data input or input the data again.\n";
					break;
				}
				break;}
			case '3':
				return ;
			case '4':
				cout<<"\nThank you for using Stephen List System.\n";			//選擇退出整個程序
				system("pause");
				exit(1);
			default:{					//如果輸入操作錯誤
				reselect=false;
				cout<<"Error Input.Please input again:\n";
				selection=getch();
				break;}
			}
			if(reselect)				//正確輸入后重新返回到子菜單
			{
				cout<<"\n\n1.Output before sort. \n2.Output after sort. \n3.Return to mainmenu.\n4.Exit.\nselect an operation: \n";
				selection=getch();
			}
	   }
}

template<class DataType>
void Interface<DataType>::Search(const Chain<DataType> &List) const				//搜索模塊
{
	bool reselect;
	char selection;
	cout<<"\n\n*****Search Module***** ";
	cout<<"\n1.Search by value. \n2.Search by index. \n3.return to mainmenu. \n4.Exit.\nselect an operation: \n";	//按值查找,按索引查找,返回主菜單,退出程序
	selection=getch();
	while(1)
	{
		reselect=true;
		switch(selection)
		{
		case '1':{
			cout<<"Input a value you want to search: ";
			int s;
			cin>>s;
			int index=List.Search(s);
			if(index)
				cout<<"The index of the value is : "<<index;
			else
				cout<<"Sorry , the element you have input isn't in the list.";
			break;}
		case '2':{
			cout<<"Input the index you want to search: ";
			int i;
			cin>>i;
			int value;
			bool check=false;
			try
			{
				check=List.Find(i,value);
			}
			catch(Error)
			{
				cout<<"\nThe out_of_Bounds index you have input cause error.\nPlease reselect the operation.\n";
				break;
			}
			if(check)
				cout<<"The value of the index is : " << value;
			else
				cout<<"Index no exist." <<endl;
			break;}
		case '3':
			return ;
		case '4':
			cout<<"\nThank you for using Stephen List System.\n";
			system("pause");
			exit(1);
		default:{
			reselect=false;
			cout<<"Error Input.Please input again: \n";
			selection=getch();
			break;}
		}
		if(reselect)
		{
			cout<<"\n\n1.Search by value. \n2.Search by index. \n3.return to mainmenu. \n4.Exit.\nselect an operation: \n";
			selection=getch();
		}
	}
}

template<class DataType>
void Interface<DataType>::Operation()				//主菜單方法,是一個程序和用戶的接口
{
	cout<<"Welcome to Stephen's System.\n\n\n";
	Chain<DataType> List;

	//開始就為用戶建立一個空的線性表,用戶可以對線性表進行插入,刪除,取長度,輸出,合并等一系列的操作
	cout<<"Instructions:\nAn empty List have been created.\nYou can select the operations below to munipulate the List.\n";
	cout<<"\n\n**********MainMenu**********\n";
	cout<<"1.Add or Delete data.\n   .....you can insert a new data or delete the data from the list.\n";
	cout<<"2.Search value.\n   .....you can search a element by value or index.\n";
	cout<<"3.Get Length.\n   .....you can get the length of the list you have input.\n";
	cout<<"4.Output data.\n   .....you can output the data by sort or not.\n";
	cout<<"5.Combination.\n   .....you can combine two list and output the combination.\n";
	cout<<"6.Exit.\n";
	cout<<"Select an operation:  ";


	bool reselect;
	char selection;
	selection=getch();

	while(1)
	{
		reselect=true;
		switch(selection)
		{
		case '1':
			this->List_Manipulation(List);		//調用增刪元素模塊
			break;
		case '2':
			this->Search(List);			//調用搜索模塊
			break;
		case '3':
			this->GetLength(List);			//調用取長度模塊
			break;
		case '4':
			this->Output(List);				//調用輸出模塊
			break;
		case '5':
			this->Combine(List);			//調用合并線性表模塊
			break;
		case '6':
			cout<<"\nThank you for using Stephen List System.\n";
			system("pause");
			exit(1);
		default:{
			reselect=false;
			cout<<"Input Error.Please input again: \n";
			selection=getch();
			break;}
		}
		if(reselect)
		{
				cout<<"\n\n**********MainMenu**********\n";
				cout<<"1.Add or Delete data.\n.....you can insert a new data or delete the data from the list.\n";
				cout<<"2.Search value.\n   .....you can search a element by value or index.\n";
				cout<<"3.Get Length.\n   .....you can get the length of the list you have input.\n";
				cout<<"4.Output data.\n   .....you can output the data by sort or not.\n";
				cout<<"5.Combination.\n   .....you can combine two list and output the combination.\n";
				cout<<"6.Exit.\n";
				cout<<"Select an operation:  ";
				selection=getch();
		}
	}
	
}

template<class DataType>
void Interface<DataType>::Combine(const Chain<DataType> &List) const
{
	cout<<"\n\n*****Combination Module*****";
	cout<<"\nAt present ,you only have one list in the memory,you need to add anthor list :";		//需要再增加一個線性表
	Chain<DataType> ComList;
	char selection='y';
	while(selection=='y' || selection=='Y')				//判斷是否再繼續輸入
	{
				int index=1;
				DataType value;
				cout<<"\nInput the value: ";
				cin>>value;
				try
				{
					ComList.Insert(index,value);
				}
				catch(Error)
				{
					cout<<"\nThe index you input caused error.\nPlease check the index.\n";
					break;
				}
				cout<<"\nAfter the insertion:"<<ComList<<endl;
				cout<<"\nInsert Continue?(y/n) select:   ";
				selection=getch();
				++index;
	}
	cout<<"\nInput Complete!\n";

	Chain<DataType> CombineList(List);
	CombineList.Sort();
	ComList.Sort();

	Chain<DataType> Combinated_List;
	Combinated_List.Combination(CombineList,ComList);
	
	cout<<"\nAfter sorted Combination of the two list:\n";
	cout<<Combinated_List;
}

template<class DataType>
void Interface<DataType>::List_Manipulation(Chain<DataType> &List)				//增刪元素模塊
{
	cout<<"\n\n*****Insert and Delete Module*****";		//插入元素,刪除元素,返回主菜單,退出程序
	cout<<"\n1.Insert element.\n2.Delete element.\n3.Return to mainmenu.\n4.Exit.\nSelect an operation:\n";
	char selection;
	bool reselect;
	selection=getch();
	while(1)
	{
			reselect=true;
			switch(selection)
			{
			case '1':{
				int index;
				DataType value;
				cout<<"\nInput the index :";
				cin>>index;
				cout<<"Input the value: ";
				cin>>value;
				try
				{
					List.Insert(index,value);
				}
				catch(Error)
				{
					cout<<"\nThe index you input caused error.\nPlease check the index.\n";
					break;
				}
				cout<<"\nAfter the insertion:\n"<<List<<endl;
				cout<<"\nInput complete!\n";
				break;}
			case '2':{
				int index;
				DataType value;
				cout<<"\nInput the index : ";
				cin>>index;
				try
				{
					List.Delete(index,value);
				}
				catch(Error)
				{
					cout<<"\nThe index you input caused error.\nPlease check the index.\n";
					break;
				}
				cout<<"You delete the data : "<<value<<endl;
				cout<<"After delete:\n";
				cout<<List<<endl;
				break;}
			case '3':
				return ;
			case '4':
				cout<<"\nThank you for using Stephen List System.\n";
				system("pause");
				exit(1);
			default:{
				reselect=false;
				cout<<"Error Input.Please input again:\n";
				selection=getch();
				break;}
			}
			if(reselect)
			{
				cout<<"\n1.Insert element.\n2.Delete element.\n3.Return to mainmenu.\n4.Exit.\nSelect an operation:\n";
				selection=getch();
			}
	}
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
eeuss国产一区二区三区| 欧美视频日韩视频| 伊人色综合久久天天| 91精品国产乱码久久蜜臀| 国产伦精一区二区三区| 亚洲免费在线视频一区 二区| 欧美日韩国产区一| 99精品国产一区二区三区不卡| 日产精品久久久久久久性色| 国产精品国产三级国产aⅴ中文| 在线播放欧美女士性生活| 播五月开心婷婷综合| 久久精品99久久久| 亚洲一区在线观看免费观看电影高清| 精品国产乱码久久久久久影片| 在线视频亚洲一区| 成人免费精品视频| 精品在线播放免费| 日韩二区三区四区| 一区二区免费看| 日本一区二区视频在线| 日韩一区二区免费电影| 欧美美女激情18p| 94色蜜桃网一区二区三区| 国产一区二区在线电影| 蜜桃传媒麻豆第一区在线观看| 亚洲区小说区图片区qvod| 中国色在线观看另类| 欧美tickle裸体挠脚心vk| 欧美裸体一区二区三区| 欧美亚洲国产一区二区三区va| 99久久婷婷国产综合精品| 成人高清视频在线| 国产激情91久久精品导航 | 欧美丝袜自拍制服另类| 大白屁股一区二区视频| 国产精品一区二区黑丝| 久久超级碰视频| 日本在线不卡一区| 日韩精品视频网站| 亚洲成av人片在线观看无码| 亚洲欧美电影一区二区| 亚洲欧美日本韩国| 亚洲美女屁股眼交3| 亚洲欧洲av另类| 国产精品久久免费看| 亚洲欧洲一区二区三区| 18欧美乱大交hd1984| 中文一区在线播放| 亚洲欧洲日韩女同| 亚洲人一二三区| 亚洲婷婷综合久久一本伊一区| 亚洲欧洲日产国码二区| 亚洲精品网站在线观看| 亚洲品质自拍视频| 亚洲高清视频在线| 欧美96一区二区免费视频| 美女在线视频一区| 国产美女视频一区| 99久久伊人久久99| 欧美视频完全免费看| 日韩一区二区在线播放| 久久奇米777| 国产精品国产三级国产普通话99| 亚洲美女屁股眼交| 天天射综合影视| 精品亚洲aⅴ乱码一区二区三区| 久久99精品网久久| 成人97人人超碰人人99| 在线视频欧美精品| 制服丝袜日韩国产| 久久亚洲二区三区| 亚洲三级电影网站| 天堂午夜影视日韩欧美一区二区| 美女在线视频一区| www.亚洲国产| 欧美乱妇23p| 久久蜜桃香蕉精品一区二区三区| 亚洲三级小视频| 日本va欧美va欧美va精品| 国产河南妇女毛片精品久久久 | 免费人成黄页网站在线一区二区 | 在线观看成人免费视频| 91麻豆精品国产综合久久久久久 | 香蕉av福利精品导航| 久久黄色级2电影| www.欧美日韩| 欧美另类久久久品| 国产精品麻豆欧美日韩ww| 亚洲国产精品久久艾草纯爱| 精品一区二区在线视频| 97超碰欧美中文字幕| 日韩亚洲欧美中文三级| 国产精品电影院| 男女男精品视频| 色综合激情五月| 久久人人爽爽爽人久久久| 亚洲在线中文字幕| 国产毛片精品国产一区二区三区| 日本丶国产丶欧美色综合| 久久综合999| 午夜一区二区三区视频| 成人免费三级在线| 精品国产污网站| 亚洲动漫第一页| 成人精品高清在线| 日韩免费在线观看| 五月婷婷另类国产| 99视频精品在线| 久久综合久久综合久久综合| 亚洲一二三区视频在线观看| 成人一级片在线观看| 精品久久国产老人久久综合| 亚洲国产精品久久久久婷婷884| 成人免费的视频| 久久综合久久综合九色| 日韩高清不卡一区二区三区| 欧美在线色视频| 亚洲欧美一区二区三区久本道91| 国产一区二区不卡在线| 欧美一级淫片007| 亚洲国产va精品久久久不卡综合| 91在线视频免费观看| 中文字幕成人av| 精品一区二区在线视频| 日韩欧美国产不卡| 日韩av午夜在线观看| 欧美无砖砖区免费| 亚洲精品精品亚洲| caoporm超碰国产精品| 国产精品欧美久久久久无广告 | 从欧美一区二区三区| 久久综合色婷婷| 国产一区美女在线| 久久久久久97三级| 国产乱码精品一区二区三区av| 6080午夜不卡| 日本美女一区二区| 欧美一区欧美二区| 免费久久精品视频| 日韩三级视频在线看| 美女在线视频一区| 久久综合色8888| 国产iv一区二区三区| 久久九九全国免费| 成人免费高清在线| 日韩美女视频一区| 日本道色综合久久| 亚洲午夜视频在线观看| 欧美另类变人与禽xxxxx| 日本视频一区二区三区| 欧美电影免费观看完整版| 久久99蜜桃精品| 国产日韩亚洲欧美综合| 成人av在线网站| 亚洲欧美日韩国产中文在线| 97se亚洲国产综合自在线| 亚洲午夜成aⅴ人片| 欧美精品久久久久久久多人混战| 男女男精品视频网| 国产亚洲欧美日韩在线一区| www.av亚洲| 亚洲影院理伦片| 日韩一区二区免费在线观看| 国产伦精品一区二区三区免费迷| 国产精品天天摸av网| 色综合色综合色综合色综合色综合 | 免费欧美日韩国产三级电影| 久久久精品国产免费观看同学| 成人短视频下载| 亚洲国产综合色| 久久久久久久久97黄色工厂| 91网址在线看| 秋霞午夜鲁丝一区二区老狼| 久久精品人人爽人人爽| 色猫猫国产区一区二在线视频| 日韩电影在线观看电影| 久久免费午夜影院| 91黄色免费看| 久久精品国内一区二区三区| 国产精品网站在线| 欧美精品久久天天躁| 成人午夜大片免费观看| 日韩精品一二三| 亚洲国产成人私人影院tom| 欧美精品一二三区| 国产 欧美在线| 日本亚洲一区二区| 一区二区三区在线免费| 日韩欧美成人午夜| 91麻豆视频网站| 激情偷乱视频一区二区三区| 亚洲免费在线视频一区 二区| 精品乱码亚洲一区二区不卡| 色哟哟一区二区| 国产精品一区一区三区| 婷婷成人综合网| 亚洲欧美偷拍三级| 久久久国际精品| 日韩欧美一级精品久久|