1) Can an undirected graph's adjacency list be represented using HashMap?
HashMap<String,ArrayList<String>>
?
Key will be nodes and ArraList will be the edges. If answer is "yes" to (1) - How do I check the redundancy here?
Eg:
1 -> 2,3,4
2 -> 1,5,6
... The 1->2 & 2->1 are same.
In this case, How to do a BFS/DFS using this data structure?!