public bool MoveNext() { BinaryTreeCellsNode oldCurrentRight = current.right; current = current.left; if (current == (Object)null) { if (oldCurrentRight != (Object)null) { current = oldCurrentRight; } else { if (RightNode.Count == 0) { return(false); } current = RightNode.Pop(); // В стеке ещё есть праый узел, Переходим на него } } else if (oldCurrentRight != (Object)null) { RightNode.Push(oldCurrentRight); } return(true); }
protected virtual void Dispose(bool disposing) { if (disposing) { current = null; RightNode = null; } }
public void Reset() { current = new BinaryTreeCellsNode(null) { left = cells.First(), right = null, parent = null }; }
public void SetParentLeftOrRight(BinaryTreeCellsNode node) { switch (Side()) { case SideNode.Left: parent.left = node; break; case SideNode.Right: parent.right = node; break; } }
public bool Equals(BinaryTreeCellsNode other) { return(cell.Equals(other.cell)); }
public int CompareTo(BinaryTreeCellsNode other) => cell.CompareTo(other.cell);