public bool SetNext(int nodeId, int nextNode) { if (nodeId < nodes) { this.next[nodeId] = nextNode; return true; } return false; }