⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f.cpp

📁 自己在以前学数据结构时用C++模板写的一些常用数据,都测试过
💻 CPP
字号:
#include<iostream.h>
#include<iomanip.h>
//#include"sort.h"
//#include"queue.h"
//#include"tree.h"
//#include"stack.h"
//#include"list.h"
//#include"heap.h"
//#include"threadtree.h"
#include"graph.h"
//#include"huffman.h"
//#include"bst.h"
//#include"search.h"
int main()
{	
	//HashTable<int> f;
	/*BST<int> f(0);
	BSTNode<int> *p;
	p=f.GetRoot();
	cout<<f.Height(p->LChild())<<setw(3)<<f.Height(p->RChild());
	f.PrintTree();
	cout<<endl;
	cout<<f.Max()<<setw(3)<<f.Min()<<endl;
	f.Insert(8);
	f.Remove(63);
	f.PrintTree();
	*/
	/*Huffman<int> f1;
	TreeNode<int> *p=f1.GetRoot();
	cout<<p->data<<endl;
	p=f1.CreatHuffman();
	cout<<p->data<<endl;
	f1.Code(p,0);*/
	/*ThreadTree<char> f1;
	f1.CreatTree();
	ThreadTreeNode<char> *p=f1.GetRoot();
	f1.PostThreadTree();
	f1.PreOrder(p);
	f1.InOrder();
	cout<<"ficu"<<endl;
	f1.PreOrder();
	f1.PostOrder();*///要用栈将顺序改变一下
	
	//int a[10]={74,6,57,8,3,465,78,34,658,67};
	//Sort<int> f;
	//for(int k=0;k<10;k++)
		//cout<<a[k]<<setw(5);
	//cout<<endl;
	//f.QuickSort(a,0,9);
	//for( k=0;k<10;k++)
		//cout<<a[k]<<setw(5);
	//cout<<endl;
	//f.Creat();
	//f.QuickSort(0,f.GetLen()-1);
	//f.Print();
	/*BinTree<char> f1;
	f1.CreatTree();
	TreeNode<char> *p=f1.GetRoot();
	cout<<"the preorder:";
	f1.PreOrder(p);
	cout<<endl;
	cout<<"the preorderN:";
	f1.PreOrderN(p);
	cout<<endl;
	cout<<"the Inorder:";
	f1.InOrder(p);
	cout<<endl;
	cout<<"the InorderN:";
	f1.InOrderN(p);
	cout<<endl;
	cout<<"the Postorder:";
	f1.PostOrder(p);
	cout<<endl;
	//cout<<f1.Depth(p);
	//cout<<f1.CountNode(p);
	f1.PostOrderN(p);*/
	//Stack<char> f2;
	//for(int i=0;i<10;i++)
		//f2.Push('a');
	//while(!f2.IsEmpty())
		//cout<<f2.Pop();
	//Queue<int> f;
	/*List<int> f3;
	f3.InsertEnd(41);
	f3.InsertEnd(4);
	f3.InsertEnd(1);
	f3.InsertEnd(5);
	f3.InsertEnd(7);
	f3.Print();
	f3.SelectSort();
	f3.Print();*/
	MGraph<int> f;
	f.CreatGraph();
	//f.DFS();
	//f.BFS();
	//f.MinTree();
	
	//f.Creat();
	//f.PrintNode();
	//f.TopologicalOrder();
	f.ShortPath(0);
	 return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -