Pointer-based binary search tree manipulation