protected void SetUp() { _graphUndirectedChars = new GraphAdjacencyList <char>(GraphType.Undirected); _graphUndirectedChars.AddEdge('a', 'b'); _graphUndirectedChars.AddEdge('a', 'd'); _graphUndirectedChars.AddEdge('a', 'c'); _graphUndirectedChars.AddEdge('b', 'c'); _graphUndirectedChars.AddEdge('b', 'd'); }
private void AdjacencyListImplementation_Click(object sender, EventArgs e) { // Adding Vertex GraphAdjacencyList <int> adjacencyList1 = new GraphAdjacencyList <int>(5); GraphAdjacencyList <int> adjacencyList2 = new GraphAdjacencyList <int>(10); GraphAdjacencyList <int> adjacencyList3 = new GraphAdjacencyList <int>(15); // Adding Edge adjacencyList1.AddEdge(5, 10); adjacencyList1.AddEdge(5, 15); var neighbours = adjacencyList1.GetAllNeighbours(5); neighbours.ForEach(Console.WriteLine); }