implemented the complete api for bst.c