add sorted binary tree algorithm