Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. // ConsoleApplication4.cpp : Defines the entry point for the console application.
  2. //graph
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include "List.h"
  7. #include <stdio.h>
  8. #include "Vertex.h"
  9.  
  10. using namespace std;
  11.  
  12.  
  13. int main()
  14. {
  15.     Graph graf;
  16.  
  17.     Vertex * v1 = new Vertex(1, 1);
  18.     Vertex * v2 = new Vertex(2, 2);
  19.     Vertex * v3 = new Vertex(3, 3);
  20.     Vertex * v4 = new Vertex(4, 4);
  21.     Vertex * v5 = new Vertex(5, 6);
  22.  
  23.     graf.insert(v1);
  24.     graf.insert(v2);
  25.  
  26.     int * siblings = new int[4];
  27.  
  28.     siblings[0] = 1;
  29.     siblings[1] = 2;
  30.  
  31.     graf.insert(v3, siblings, 2);
  32.  
  33.     siblings[0] = 3;
  34.  
  35.     graf.insert(v4, siblings, 1);
  36.  
  37.     siblings[0] = 2;
  38.     siblings[1] = 3;
  39.  
  40.     graf.insert(v5, siblings, 2)
  41.  
  42.         delete[] siblings;
  43.  
  44.     return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement