Professional Documents
Culture Documents
Undirected Graph
Undirected Graph
*;
import java.util.stream.Collectors;
void showConnections(){
for(Integer vertex : this.adjList.keySet()){
String values = this.adjList.get(vertex).stream().filter(key->
key != null).map(String :: valueOf).collect(Collectors.joining(","));
System.out.println("Connections for node: "+vertex+" are
"+values);
}
}
}