Serialize BST