I have a custom made class called Graph in which I use adjacency lists. To be more specific, I have an array of hash maps where each hash map contains all that node's neighbors as edges. The key is the end node and the value is an Edge object.
Now i want to make this Graph class implement Iterable. Is there a way of merging all those hash maps and return a common Iterator for all their elements?
It's very important that the method used is efficient.