Open wb-zhang opened 5 years ago
The answer should be if prev == root->parent: print root->key; prev = root; root = root->left ? root->left : root->right ? root->right : root->parent;
The answer should be if prev == root->parent: print root->key; prev = root; root = root->left ? root->left : root->right ? root->right : root->parent;