public RbstNode GetKth(int i) { int pos = (left != null ? (int)left.size : 0); if (i == pos) { return(this); } if (i < pos) { return(left != null?left.GetKth(i) : null); } return(right != null?right.GetKth(i - pos - 1) : null); }
public RbstNode GetKth(int i) { return(root != null?root.GetKth(i) : null); }