@@ -0,0 +1,1883 @@
+package me.alivecode.algs4;%0A%0Aimport edu.princeton.cs.algs4.In;%0Aimport edu.princeton.cs.algs4.StdOut;%0A%0A/**%0A * The %7B@code SymbolGraph%7D represents a data type%0A * combine with named vertices and edges.%0A */%0Apublic class SymbolGraph %7B%0A    private BST%3CString, Integer%3E st;%0A    private String%5B%5D keys;%0A    private Graph graph;%0A%0A    public SymbolGraph(String filePath, String delim) %7B%0A        st = new BST%3C%3E();%0A        In in = new In(filePath);%0A        while(!in.isEmpty()) %7B%0A            String%5B%5D a = in.readLine().split(delim);%0A            for (int i = 0; i %3C a.length; i++) %7B%0A                if (!st.contains(a%5Bi%5D)) %7B%0A                    st.put(a%5Bi%5D, st.size());%0A                %7D%0A            %7D%0A        %7D%0A%0A        keys = new String%5Bst.size()%5D;%0A        for(String s : st.keys()) %7B%0A            keys%5Bst.get(s)%5D = s;%0A        %7D%0A%0A        graph = new Graph(st.size());%0A        in = new In(filePath);%0A        while(in.hasNextLine()) %7B%0A            String%5B%5D a = in.readLine().split(delim);%0A            for(int i = 1; i %3C a.length; i++) %7B%0A                graph.addEdge(st.get(a%5B0%5D), st.get(a%5Bi%5D));%0A            %7D%0A        %7D%0A%0A    %7D%0A%0A    public String name(int v) %7B%0A        validateVertex(v);%0A        return keys%5Bv%5D;%0A    %7D%0A%0A    public int index(String name) %7B%0A        return st.get(name);%0A    %7D%0A%0A    public boolean contains(String name) %7B%0A        return st.contains(name);%0A    %7D%0A%0A    private void validateVertex(int v) %7B%0A        int V = keys.length;%0A        if (v %3C 0 %7C%7C v %3E= V) throw new IllegalArgumentException();%0A    %7D%0A%0A    public Graph graph() %7B%0A        return graph;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        SymbolGraph sg = new SymbolGraph(args%5B0%5D, args%5B1%5D);%0A%0A        for(int v = 0; v %3C sg.graph().V(); v++) %7B%0A            StdOut.println(sg.name(v));%0A            for(int w : sg.graph().adj(v)) %7B%0A                StdOut.println(%22    %22 + sg.name(w));%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add SymbolGraph class.