fork download
  1. #ifndef _MYGRAPH
  2. #define _MYGRAPH
  3. class node
  4. {
  5. public:
  6. node* next;
  7. int index;
  8. };
  9.  
  10. //build a graph with n vertice
  11. node* build_graph(int n);
  12.  
  13. //connect index a to index b of graph
  14. void graph_connect(node* graph,int a,int b);
  15.  
  16. //show graph connecting information
  17. void show_graph(node* graph,int n);
  18.  
  19. //check whether vertex a connects to vertex b
  20. bool query_connect(node* graph,int a, int b);
  21.  
  22. #endif
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty