Binary search tree serialize deserialize