BinaryTreeNode<int> *changeval(BinaryTreeNode<int>*root,int d){
if(root==nullptr){
return nullptr;
}
root->data=d;
++d;
if (root->left) {
BinaryTreeNode<int> *t1 = changeval(root->left, d);
}
if (root->right) {
BinaryTreeNode<int> *t2 = changeval(root->right, d);
}
return root;
}
BinaryTreeNode<int> *changeToDepthTree(BinaryTreeNode<int> *root)
{
if(root==nullptr){
return nullptr;
}
root=changeval(root,0);
return root;
}





