JavaScript icon indicating copy to clipboard operation
JavaScript copied to clipboard

fixes:#1806

Open sam28u opened this issue 3 months ago • 1 comments

Add an algorithm (Morris Traversal for binary trees)

This PR adds the Morris Inorder Traversal algorithm. Morris traversal allows in-order traversal of a binary tree without using recursion or a stack. It uses threaded binary trees and runs in O(n) time with O(1) extra space.

Reference: Wikipedia – Tree traversal.

Checklist: ✅ I have read CONTRIBUTING.md. ✅ This pull request is all my own work -- I have not plagiarized. ✅ I know that pull requests will not be merged if they fail the automated tests. ✅ This PR only changes one algorithm file. ✅ The new file is placed in the correct directory (TreeTraversal/). ✅ The filename follows UpperCamelCase style: MorrisTraversal.js. ✅ I have added a Wikipedia (or equivalent) reference link in the comments. ✅ If this PR fixes an issue, my commit message contains Fixes:#1806.

sam28u avatar Oct 01 '25 19:10 sam28u

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 85.95%. Comparing base (08d8c6b) to head (bf0fe2e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1812      +/-   ##
==========================================
+ Coverage   85.91%   85.95%   +0.03%     
==========================================
  Files         379      380       +1     
  Lines       19778    19831      +53     
  Branches     3015     3022       +7     
==========================================
+ Hits        16993    17046      +53     
  Misses       2785     2785              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov-commenter avatar Oct 01 '25 19:10 codecov-commenter