algorith to perform different functions in a binary tree