List? dfsIterative(int v) { v--; List label = []; for (int i = 0; i < _amount; i++) { label.add(false); } List stack = []; stack.add(v); while (stack.isNotEmpty) { v = stack.removeLast(); if (!label[v]) { label[v] = true; for (int i in _dots[v].getL().keys) { stack.add(i - 1); } } } return label; }