SHARE
TWEET

Untitled

a guest Nov 12th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Graph:
  2.     int adj[][]
  3.     /*
  4.         Bsp. einer Adjazenmatrix mit 4 Knoten nach der instanzierung:
  5.           0  1  2  3
  6.         0|0  0  0  0
  7.         1|0  0  0  0
  8.         2|0  0  0  0
  9.         3|0  0  0  0
  10.     */
  11.  
  12.     //am anfang gibt es keine verbundenden Knoten
  13.     Graph(int amountNodes) //Konstruktor
  14.         adj[][] = new int[amountNodes][amountNodes]
  15.  
  16.     //fügt neue Kante hinzu
  17.     //von Knoten v nach Knoten w
  18.     addEdge(int v, int w)
  19.         adj[v][w] = 1 //schreibe eine 1 an die passenden Stelle in der Adjazenmatrix
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top