📄 linkedlistforgraph.h
字号:
#ifndef H_LinkedListForGraph
#define H_LinkedListForGraph
#include <iostream>
#include "linkedList.h"
using namespace std;
template<class vType>
class linkedListGraph: public linkedListType<vType>
{
public:
void getAdjacentVertices(vType adjacencyList[],
int& length);
//Function to retrieve the vertices adjacent to a given
//vertex.
//Postcondition: The vertices adjacent to a given vertex
// are retrieved in the array adjacencyList.
// The parameter length specifies the number
// of vertices adjacent to a given vertex.
};
template<class vType>
void linkedListGraph<vType>::getAdjacentVertices
(vType adjacencyList[], int& length)
{
nodeType<vType> *current;
length = 0;
current = first;
while(current != NULL)
{
adjacencyList[length++] = current->info;
current = current->link;
}
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -