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

📄 p292.cpp

📁 清华大学-数据结构 清华大学-数据结构 清华大学-数据结构
💻 CPP
字号:
#include "P267e.cpp"
		template <class NameType, class DistType> 
			class AOVGraph :public Graph<NameType,DistType>
		{
		private:
			int *count;						//入度数组, 记录各顶点的入度		   
		public:
			AOVGraph ( const int sz=DefaultSize ) ;			
			void TopologicalSort ( );
			
		};
		template <class NameType, class DistType> 		
		AOVGraph<NameType,DistType>::AOVGraph ( const int sz=DefaultSize ) 
			{
		      count = new int[sz];					//建立入度数组
			  for (int i=0;i<sz;i++) 
			    count[i]=0;
			  
			  for (i=0;i<NumVertices;i++)
			  {
				 Edge<NameType,DistType> *p=NodeTable[i].adj;
				 while (p)
				 {
					 count[p->dest]++;			  
					 p = p->link;
				 }

			  }

			};

⌨️ 快捷键说明

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