LAB 13 Data Structure Nadine ElHaddad S22107736 import java util Arrays public class Graph static void printAdjacencyMatrix int graph System out println Adjacency Matrix for int row graph System out println Arrays toString row static void printGraphWithAdjacentVertices int graph System out println nGraph with Adjacent Vertices for int i 0 i graph length i System out print Node i for int j 0 j graph i length j if graph i j 1 System out print j System out println public static void main String args int graph 0 1 0 0 1 1 0 1 1 1 0 1 0 1 0 0 1 1 0 1 1 1 0 1 0 printAdjacencyMatrix graph printGraphWithAdjacentVertices graph
View Full Document