Tuesday, February 10, 2015

IndexGraph. java in a programe



IndexGraph.java

public class IndexGraph
 {
 public static void main(String[] args)
    {

        In in = new In(args[0]);
        String delimiter = args[1];
        Graph G = new Graph(in, delimiter);

             while (!StdIn.isEmpty())
            {
            String v = StdIn.readLine();
            for (String w : G.adjacentTo(v))
           {
                StdOut.println("  " + w);
            }
        }
    }
}

No comments:

Post a Comment