I created a hashmap to represent a graph. The keys in my hash map are the vertices and the values are the edges. From my hashmap I take all of its vertices and store them in a dictionary called vertexDictionary. I would now like to set all the values of the vertex dictionary to False but I am having trouble with this. I tried to use an iterator but I am getting an error in my code with the starred line. My code is below:
public void clearMarks(){
// Sets marks for all vertices to false.
Set set = graph.entrySet();
Iterator i = set.iterator();
while(i.hasNext()) {
Map.Entry g = (Map.Entry)i.next();
*this.graph.put(g.getKey(), false);*
}
}