gzc / CLRS

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

Exercises 12.1-3 Add second algorithm(nonrecursive and no stack) #316

Open Akasakar opened 4 years ago

Akasakar commented 4 years ago

problem: a more complicated but elegant solution that uses no stack but assumes that two point- ers can be tested for equality.

how to solve the other way you can see Morris Traversal

Morris Inorder Tree Traversal 二叉树的非递归遍历(不用栈、O(1)空间)