@@ -0,0 +1,1100 @@
+import java.util.ArrayList;%0D%0Aimport java.util.HashMap;%0D%0A%0D%0Apublic class Digraph %7B%0D%0A%0D%0A    private HashMap%3CInteger, ArrayList%3CInteger%3E%3E adj;%0D%0A%0D%0A    public Digraph() %7B%0D%0A        adj = new HashMap%3C%3E();%0D%0A    %7D%0D%0A%0D%0A    public static void main(String%5B%5D args) %7B%0D%0A%0D%0A%0D%0A        Digraph g = new Digraph();%0D%0A%0D%0A        g.addEdge(1, 2);%0D%0A        g.addEdge(1, 3);%0D%0A        g.addEdge(1, 4);%0D%0A        g.addEdge(1, 5);%0D%0A%0D%0A        System.out.println(g.toString());%0D%0A        System.out.println(g.isConnected(1, 2));%0D%0A        System.out.println(g.isConnected(6, 1));%0D%0A    %7D%0D%0A%0D%0A    public void addEdge(int v1, int v2) %7B%0D%0A%0D%0A        if (adj.containsKey((v1))) %7B%0D%0A            if (adj.get(v1).contains(v2)) return;%0D%0A            adj.get(v1).add(v2);%0D%0A        %7D else %7B%0D%0A            adj.put(v1, new ArrayList%3C%3E());%0D%0A            adj.get(v1).add(v2);%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    public boolean isConnected(int v1, int v2) %7B%0D%0A        if (adj.containsKey(v1)) %7B%0D%0A            return adj.get(v1).contains(v2);%0D%0A        %7D%0D%0A        return isConnected(v2, v1);%0D%0A    %7D%0D%0A%0D%0A    public String toString() %7B%0D%0A        return adj.toString();%0D%0A    %7D%0D%0A%7D%0D%0A

The answer to the question 4: this reloves #7