Added build function for the SearchTree class.