Some binary search tree related functions.