binary tree serialize