数据结构中实现图的遍历

时间:2013-12-28 11:47:06
【文件属性】:

文件名称:数据结构中实现图的遍历

文件大小:786KB

文件格式:RAR

更新时间:2013-12-28 11:47:06

数据结构图的遍历

数据结构图的遍历class LinkedDigraph; class LinkedGraph; template class LinkedWDigraph; template class LinkedWGraph; template class LinkedBase: virtual public Network { friend class LinkedDigraph; friend class LinkedGraph; friend class LinkedWDigraph; friend class LinkedWGraph; /* friend class Network;*/ public: void InitializePos() {pos = new ChainIterator [n+1];} void DeactivatePos() {delete [] pos;} LinkedBase(int Vertices = 10) {n = Vertices; e = 0; h = new Chain [n+1];} ~LinkedBase() {delete [] h;} int Edges() const {return e;} int Vertices() const {return n;} int OutDegree(int i) const {if (i < 1 || i > n) throw OutOfBounds(); return h[i].Length();} void Output() const; private: ChainIterator *pos; int n; // number of vertices int e; // number of edges Chain *h; // adjacency list array }; template void LinkedBase::Output() const {// Output the adjacency lists. for (int i = 1; i <= n; i++) { cout << "Vertex " << i << " = ";


【文件预览】:
第五次实习 图的遍历
----picture.suo(22KB)
----picture.sln(886B)
----picture.ncb(1.5MB)
----picture()
--------lbase.h(1KB)
--------stdafx.h(378B)
--------fchain.h(5KB)
--------node.h(266B)
--------network.h(4KB)
--------ldigraph.h(2KB)
--------picture.vcproj(5KB)
--------lqueue.h(2KB)
--------lstack.h(1KB)
--------Debug()
--------stdafx.cpp(212B)
--------picture.cpp(1KB)
--------cnode.h(424B)
--------ReadMe.txt(950B)
--------xcept.h(1KB)
--------ChainIterator.h(644B)
--------picture.vcproj.sony-PC.sony.user(1KB)
--------lgraph.h(2KB)
----debug()
--------picture.pdb(635KB)
--------picture.ilk(810KB)
--------picture.exe(72KB)

网友评论