gzc / CLRS

:notebook:Solutions to Introduction to Algorithms
MIT License
9.44k stars 2.75k forks source link

Exercises 10.4-5 #304

Open wb-zhang opened 5 years ago

wb-zhang commented 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;