Remove nodes outside range from binary search tree and minimum height of a binary tree