public int IndexOf(T value) { int compare = value.CompareTo(Value); if (compare == 0) { if (LeftHand == null) { return(0); } else { int temp = LeftHand.IndexOf(value); return(temp == -1 ? LeftHand.Count : temp); } } if (compare < 0) { if (LeftHand == null) { return(-1); } else { return(LeftHand.IndexOf(value)); } } else { if (RightHand == null) { return(-1); } else { return(RightHand.IndexOf(value)); } } }