René's URL Explorer Experiment


Title: [FEATURE]: Add Morris Traversal Algorithm · Issue #1806 · TheAlgorithms/JavaScript · GitHub

Open Graph Title: [FEATURE]: Add Morris Traversal Algorithm · Issue #1806 · TheAlgorithms/JavaScript

X Title: [FEATURE]: Add Morris Traversal Algorithm · Issue #1806 · TheAlgorithms/JavaScript

Description: Motivation Describe your change: Add an algorithm? Fix a bug or typo in an existing algorithm? Documentation change? Checklist: I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Javascript/blob/master/CONTRIBUTING.md). This ...

Open Graph Description: Motivation Describe your change: Add an algorithm? Fix a bug or typo in an existing algorithm? Documentation change? Checklist: I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Javasc...

X Description: Motivation Describe your change: Add an algorithm? Fix a bug or typo in an existing algorithm? Documentation change? Checklist: I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Javasc...

Opengraph URL: https://github.com/TheAlgorithms/JavaScript/issues/1806

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[FEATURE]: Add Morris Traversal Algorithm","articleBody":"### Motivation\n\n\n\u003e ### Describe your change:\n\u003e\n\u003e *  [x] Add an algorithm?\n\u003e *  [ ] Fix a bug or typo in an existing algorithm?\n\u003e *  [ ] Documentation change?\n\u003e\n\u003e ### Checklist:\n\u003e\n\u003e *  [x] I have read [[CONTRIBUTING.md](https://github.com/TheAlgorithms/Javascript/blob/master/CONTRIBUTING.md)](https://github.com/TheAlgorithms/Javascript/blob/master/CONTRIBUTING.md).\n\u003e *  [x] This pull request is all my own work -- I have not plagiarized.\n\u003e *  [x] I know that pull requests will not be merged if they fail the automated tests.\n\u003e *  [x] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.\n\u003e *  [x] All new JavaScript files are placed inside an existing directory.\n\u003e *  [x] All filenames should use the UpperCamelCase (PascalCase) style. There should be no spaces in filenames.\n\u003e   **Example:** `UserProfile.js` is allowed but `userprofile.js`,`Userprofile.js`,`user-Profile.js`,`userProfile.js` are not.\n\u003e *  [x] All new algorithms have a URL in their comments that points to Wikipedia or another similar explanation.\n\u003e   **Example:** [[Morris Traversal - Wikipedia](https://en.wikipedia.org/wiki/Threaded_binary_tree#Morris_traversal)](https://en.wikipedia.org/wiki/Threaded_binary_tree#Morris_traversal)\n\u003e *  [ ] If this pull request resolves one or more open issues then the commit message contains `Fixes: #{$ISSUE_NO}`.\n\u003e *  [ ] closes\n\n### Examples\n\n            7\n           / \\\n          5   8\n         / \\\n        3   6\n             \\\n              9\n\n\nTraversal order (Inorder: Left → Root → Right):\nStep 1: Visit leftmost node → 3\nStep 2: Back to parent → 5\nStep 3: Move to right subtree → 6\nStep 4: Right child of 6 → 9\nStep 5: Back to root → 7\nStep 6: Right child of root → 8\n\nFinal output sequence:\n3, 5, 6, 9, 7, 8\n\n\n### Possible workarounds\n\n\u003chtml\u003e\n\u003cbody\u003e\n\u003c!--StartFragment--\u003e\u003ch3 data-start=\"648\" data-end=\"706\"\u003e\u003cstrong data-start=\"652\" data-end=\"706\"\u003ePossible Workarounds – Conceptual Illustration\u003c/strong\u003e\u003c/h3\u003e\n\u003cdiv class=\"_tableContainer_1rjym_1\"\u003e\u003cdiv tabindex=\"-1\" class=\"group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse\"\u003e\nMethod | Space Complexity | Notes\n-- | -- | --\nRecursive Inorder Traversal | O(h) | Uses call stack; simple but not O(1)\nIterative Inorder with Stack | O(h) | Explicit stack; simulates recursion\nThreaded Binary Tree | O(1) | Permanently modifies tree pointers for threads\n\n\u003c/div\u003e\u003c/div\u003e\n\u003cp data-start=\"1211\" data-end=\"1232\"\u003e\u003cstrong data-start=\"1211\" data-end=\"1230\"\u003eVisual analogy:\u003c/strong\u003e\u003c/p\u003e\n\u003cul data-start=\"1233\" data-end=\"1515\"\u003e\n\u003cli data-start=\"1233\" data-end=\"1319\"\u003e\n\u003cp data-start=\"1235\" data-end=\"1319\"\u003e\u003cstrong data-start=\"1235\" data-end=\"1256\"\u003eRecursive / Stack\u003c/strong\u003e → climbing stairs with a backpack (stack grows with height).\u003c/p\u003e\n\u003c/li\u003e\n\u003cli data-start=\"1320\" data-end=\"1414\"\u003e\n\u003cp data-start=\"1322\" data-end=\"1414\"\u003e\u003cstrong data-start=\"1322\" data-end=\"1342\"\u003eMorris Traversal\u003c/strong\u003e → climbing stairs using only your hands on rails (no extra backpack).\u003c/p\u003e\n\u003c/li\u003e\n\u003cli data-start=\"1415\" data-end=\"1515\"\u003e\n\u003cp data-start=\"1417\" data-end=\"1515\"\u003e\u003cstrong data-start=\"1417\" data-end=\"1434\"\u003eThreaded Tree\u003c/strong\u003e → installing permanent rails on stairs (extra setup, but efficient traversal).\u003c/p\u003e\u003c/li\u003e\u003c/ul\u003e\u003c!--EndFragment--\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n\n### Additional information\n\nAdditional Information – Illustration\n\nKey Points about Morris Traversal:\n\nMemory Efficient: Uses O(1) extra space, unlike recursion or stack.\n\nInorder Traversal: Left → Root → Right.\n\nTemporary Tree Modification: Creates “threads” to revisit nodes.\n\nFuture Extension: Preorder Morris Traversal is possible with minor changes.\n\nReference: Wikipedia → Threaded binary tree / Morris Traversal.\n\nConceptual Analogy:\n\nNormal Traversal (Stack/Recursion) → Carrying bags for each level\nMorris Traversal → Using built-in tree connections temporarily, no bags\nThreaded Tree → Installing permanent pathways for future traversals","author":{"url":"https://github.com/aniket866","@type":"Person","name":"aniket866"},"datePublished":"2025-09-29T20:54:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1806/JavaScript/issues/1806"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:084f239e-6ab7-192a-d7fd-4c2e77688fa8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id98B0:1B5D7A:588B878:78E7FF8:696E41B8
html-safe-nonce714a3b3367a2d55ba18d24aaedb3d8c82b73e594992228eb522e9a36f0dcfd59
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEIwOjFCNUQ3QTo1ODhCODc4Ojc4RTdGRjg6Njk2RTQxQjgiLCJ2aXNpdG9yX2lkIjoiMTc5OTI3MDU1NDkzMDEzNTQ4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac5b52590145e3ca7e3196842ace5e32dcb69ce5d25c80a6e0588e20a6b390282e
hovercard-subject-tagissue:3466587281
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TheAlgorithms/JavaScript/1806/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1cd0fe0bbc436640b1d25b4c3fa488e8d57b6fed540cb55aa2e8ec0d33830d30/TheAlgorithms/JavaScript/issues/1806
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1cd0fe0bbc436640b1d25b4c3fa488e8d57b6fed540cb55aa2e8ec0d33830d30/TheAlgorithms/JavaScript/issues/1806
og:image:altMotivation Describe your change: Add an algorithm? Fix a bug or typo in an existing algorithm? Documentation change? Checklist: I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Javasc...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameaniket866
hostnamegithub.com
expected-hostnamegithub.com
Noneabd163b7d9c46b4a930c1f194b3178a41170cabf658619a75407b1f9208b96e4
turbo-cache-controlno-preview
go-importgithub.com/TheAlgorithms/JavaScript git https://github.com/TheAlgorithms/JavaScript.git
octolytics-dimension-user_id20487725
octolytics-dimension-user_loginTheAlgorithms
octolytics-dimension-repository_id97086543
octolytics-dimension-repository_nwoTheAlgorithms/JavaScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id97086543
octolytics-dimension-repository_network_root_nwoTheAlgorithms/JavaScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9072c2b7e26adf699c492532ab0d77c337ccb0ac
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/issues/1806#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FTheAlgorithms%2FJavaScript%2Fissues%2F1806
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FTheAlgorithms%2FJavaScript%2Fissues%2F1806
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=TheAlgorithms%2FJavaScript
Reloadhttps://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/issues/1806
Reloadhttps://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/issues/1806
Reloadhttps://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/issues/1806
TheAlgorithms https://patch-diff.githubusercontent.com/TheAlgorithms
JavaScripthttps://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript
Please reload this pagehttps://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/issues/1806
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FTheAlgorithms%2FJavaScript
Fork 5.8k https://patch-diff.githubusercontent.com/login?return_to=%2FTheAlgorithms%2FJavaScript
Star 34k https://patch-diff.githubusercontent.com/login?return_to=%2FTheAlgorithms%2FJavaScript
Code https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript
Issues 21 https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/issues
Pull requests 167 https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/pulls
Actions https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/actions
Projects 0 https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/projects
Wiki https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/security
Please reload this pagehttps://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/issues/1806
Insights https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/pulse
Code https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript
Issues https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/issues
Pull requests https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/pulls
Actions https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/actions
Projects https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/projects
Wiki https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/wiki
Security https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/security
Insights https://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/TheAlgorithms/JavaScript/issues/1806
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/TheAlgorithms/JavaScript/issues/1806
[FEATURE]: Add Morris Traversal Algorithmhttps://patch-diff.githubusercontent.com/TheAlgorithms/JavaScript/issues/1806#top
https://github.com/aniket866
https://github.com/aniket866
aniket866https://github.com/aniket866
on Sep 29, 2025https://github.com/TheAlgorithms/JavaScript/issues/1806#issue-3466587281
CONTRIBUTING.mdhttps://github.com/TheAlgorithms/Javascript/blob/master/CONTRIBUTING.md
https://github.com/TheAlgorithms/Javascript/blob/master/CONTRIBUTING.mdhttps://github.com/TheAlgorithms/Javascript/blob/master/CONTRIBUTING.md
Morris Traversal - Wikipediahttps://en.wikipedia.org/wiki/Threaded_binary_tree#Morris_traversal
https://en.wikipedia.org/wiki/Threaded_binary_tree#Morris_traversalhttps://en.wikipedia.org/wiki/Threaded_binary_tree#Morris_traversal
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.