C-Plus-Plus icon indicating copy to clipboard operation
C-Plus-Plus copied to clipboard

feat: add morris in order traversal

Open Lovish-Singlaa opened this issue 1 year ago • 6 comments

Description of Change

Morris Inorder Traversal is a way to perform an in-order traversal of a binary tree without using recursion or a stack, by creating temporary threads to predecessors. It modifies the tree during the traversal but restores it afterward, achieving O(1) extra space complexity.

Checklist

  • [x] Added description of change
  • [x] Added file name matches File name guidelines
  • [x] Added tests and example, test must pass
  • [x] Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • [x] Relevant documentation/comments is changed or added
  • [x] PR title follows semantic commit guidelines
  • [x] Search previous suggestions before making a new one, as yours may be a duplicate.
  • [x] I acknowledge that all my contributions will be made under the project's license.

Notes:

Lovish-Singlaa avatar Oct 05 '24 06:10 Lovish-Singlaa

thank you for your contribution. On a side note is this for hacktoberfest?

yes, it is for hacktoberfest

Lovish-Singlaa avatar Oct 05 '24 12:10 Lovish-Singlaa

https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md please read the above and implement required changes

realstealthninja avatar Oct 05 '24 12:10 realstealthninja

https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md please read the above and implement required changes

Do I have to change directory also or it is fine?

Lovish-Singlaa avatar Oct 05 '24 13:10 Lovish-Singlaa

https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md please read the above and implement required changes

Do I have to change directory also or it is fine?

i'd recommend putting this in operations_on_datastructures, afaik morris traversal is on a tree and not on a graph

realstealthninja avatar Oct 05 '24 13:10 realstealthninja

https://github.com/AYUSHSURYAVANSHI/C-Plus-Plus/commit/e1dcc3b49e30d7c9151764238d0650ab10017154#diff-86242d90684eaa0e0d368166236c68b07eee541f121514c54d02963afa395bef please add this Changes

AYUSHSURYAVANSHI avatar Oct 05 '24 14:10 AYUSHSURYAVANSHI

https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md please read the above and implement required changes

Do I have to change directory also or it is fine?

i'd recommend putting this in operations_on_datastructures, afaik morris traversal is on a tree and not on a graph

now check please

Lovish-Singlaa avatar Oct 07 '24 06:10 Lovish-Singlaa

/assign

vaishnavi878 avatar Oct 20 '24 14:10 vaishnavi878

This pull request 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] avatar Dec 12 '24 00:12 github-actions[bot]

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. 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!

github-actions[bot] avatar Dec 20 '24 00:12 github-actions[bot]