// graphRepresentAsAdjacentList.h -- graph header file.
// 2011-08-28-20.26 --
// Purpose:
// Define a class "graphRepresentAsAdjacentList".
// Declare methods of the class, and define element member.
#include <iostream>
#include <vector>
#include "binaryHeap.h"
using std ::vector ;
class graphRepresentAsAdjacentList
{
public:
typedef struct node
{
int indexInAdjacentList ;
int weight ;
struct node * next ;
} Node ;
private:
int m_size ;
int m_currentSize ;
vector<Node> m_adjacentListVector ;
Node * m_makeNode (int indexInAdjacentList, int weight) ;
public:
graphRepresentAsAdjacentList (int size = 0) ;
~graphRepresentAsAdjacentList (void) ;
bool importANode (const std ::vector<int> & indexVector, const std ::vector<int> & weightVector) ;
bool printMinmunSpanningTreeUsingPrim (int startIndex) ;
bool printGraph (void) ;
} ;
图头文件C++
最新推荐文章于 2024-05-15 15:55:17 发布