importjava.util.ArrayList;classGraph{intsize;ArrayListadj[];Graph(intsize){this.size=size;adj=newArrayList[size];for(inti=0;i<size;i++){adj[i]=newArrayList<Integer>();}}voidinsert(intu,intv){intul=u-65;intvl=v-65;adj[ul].add(vl);}voidoutgoing(charfrom){System.out.println("Nodes outgoing from "+from);intu=(char)(from)-65;for(inti=0;i<adj[u].size();i++){intv=(int)adj[u].get(i);charch=(char)(v+65);System.out.println(ch);}}}classp06{publicstaticvoidmain(String[]args){Graphgraph=newGraph(8);graph.insert('A','B');graph.insert('A','E');graph.insert('B','C');graph.insert('D','E');graph.insert('A','D');graph.outgoing('A');}}