Class UndirectedGraph<T>

  • Type Parameters:
    T - the type of node elements.


    public class UndirectedGraph<T>
    extends Graph<T>
    A class to represent an unweighted, undirected graph.
    • Constructor Detail

      • UndirectedGraph

        public UndirectedGraph()
    • Method Detail

      • addEdge

        public void addEdge(T a,
                            T b)
        Add an undirected edge to the graph.
        Overrides:
        addEdge in class  Graph<T>
        Parameters:
        a - a node.
        b - another node.
      • removeEdge

        public void removeEdge(T a,
                               T b)
        Remove an undirected edge from graph.
        Overrides:
        removeEdge in class  Graph<T>
        Parameters:
        a - a node.
        b - another node.