File: graph.h

package info (click to toggle)
iqtree 1.6.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 12,140 kB
  • sloc: cpp: 111,752; ansic: 53,619; python: 242; sh: 195; makefile: 52
file content (29 lines) | stat: -rw-r--r-- 576 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * graph.h
 *
 *  Created on: Nov 14, 2013
 *      Author: olga
 */

#include <iostream>
#include <list>
#include <limits.h>

#ifndef GRAPH_H_
#define GRAPH_H_

using namespace std;

class Graph
{
    int V;    			// No. of vertices
    list<int> *adj;		// Pointer to an array containing adjacency lists
    bool isCyclicUtil(int v, bool visited[], bool *rs);  // used by isCyclic()

public:
    Graph(int V);   // Constructor
    void addEdge(int v, int w);   // to add an edge to graph
    bool isCyclic();    // returns true if there is a cycle in this graph
};

#endif