add method
Add a Node to Graph
Return false when there is such a node
Implementation
bool add(val) {
if (_map.containsKey(val)) {
return false;
}
final node = _Node();
_map[val] = node;
_node_to_val[node] = val;
return true;
}
Add a Node to Graph
Return false when there is such a node
bool add(val) {
if (_map.containsKey(val)) {
return false;
}
final node = _Node();
_map[val] = node;
_node_to_val[node] = val;
return true;
}