/**/
        public static void main(string[] strarr)
        {
            string        str           = strarr[0];
            string        str2          = strarr[1];
            SymbolDigraph symbolDigraph = new SymbolDigraph(str, str2);
            Topological   topological   = new Topological(symbolDigraph.G());
            Iterator      iterator      = topological.order().iterator();

            while (iterator.hasNext())
            {
                int i = ((Integer)iterator.next()).intValue();
                StdOut.println(symbolDigraph.name(i));
            }
        }
Beispiel #2
0
    /**/
    public static void main(string[] strarr)
    {
        string        str           = strarr[0];
        string        str2          = strarr[1];
        SymbolDigraph symbolDigraph = new SymbolDigraph(str, str2);
        Digraph       digraph       = symbolDigraph.G();

        while (!StdIn.IsEmpty)
        {
            string   str3     = StdIn.readLine();
            Iterator iterator = digraph.adj(symbolDigraph.index(str3)).iterator();
            while (iterator.hasNext())
            {
                int i = ((Integer)iterator.next()).intValue();
                StdOut.println(new StringBuilder().append("   ").append(symbolDigraph.name(i)).toString());
            }
        }
    }