binary_tree and binary_search implementation