public Tree Balance() { int cmp = _subsequent.Nodes() - _preceding.Nodes(); if (cmp < -2) { return(RotateRight()); } else { if (cmp > 2) { return(RotateLeft()); } else { SetSizeOwnPrecedingSubsequent(); return(this); } } }
public Tree Balance() { int cmp = _subsequent.Nodes() - _preceding.Nodes(); if (cmp < -2) { return(RotateRight()); } else { if (cmp > 2) { return(RotateLeft()); } else { SetSizeOwnPrecedingSubsequent(); return(this); } } }