C++ binary search tree implementation