TheAlgorithms / C-Plus-Plus

Collection of various algorithms in mathematics, machine learning, computer science and physics implemented in C++ for educational purposes.
https://thealgorithms.github.io/C-Plus-Plus
MIT License
30.03k stars 7.1k forks source link

MorrisPreOrder Traversal #2621

Closed mkhuzaima closed 9 months ago

mkhuzaima commented 11 months ago

Detailed description

Morris Traversal is an algorithm for Binary tree traversal in O(1) space.

https://en.wikipedia.org/wiki/Tree_traversal

Context

It can help users to understand how morris traversal works, and how it can be used for preorder traversal.Morris

Possible implementation

It is implemented with threaded traversal. i.e., changing tree internally during traversal and restoring it to original state.

Additional information

No response

github-actions[bot] commented 9 months ago

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 9 months ago

Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!