{"id":29666668,"url":"https://github.com/sinistersnare/robson","last_synced_at":"2025-07-22T15:39:27.080Z","repository":{"id":68644308,"uuid":"94503239","full_name":"sinistersnare/Robson","owner":"sinistersnare","description":"Traversing Trees in O(1) space!!","archived":false,"fork":false,"pushed_at":"2022-04-22T14:09:26.000Z","size":495,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-13T15:45:44.205Z","etag":null,"topics":["algorithm","c","link-inversion","robson","robson-traversal","tree","tree-traversal","tree-traversal-algorithm"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinistersnare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-06-16T03:55:05.000Z","updated_at":"2023-04-09T19:40:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7c37cc6-1d30-4d1e-ba06-a0b07d78b933","html_url":"https://github.com/sinistersnare/Robson","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sinistersnare/Robson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinistersnare%2FRobson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinistersnare%2FRobson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinistersnare%2FRobson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinistersnare%2FRobson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinistersnare","download_url":"https://codeload.github.com/sinistersnare/Robson/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinistersnare%2FRobson/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266522064,"owners_count":23942565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","c","link-inversion","robson","robson-traversal","tree","tree-traversal","tree-traversal-algorithm"],"created_at":"2025-07-22T15:39:14.584Z","updated_at":"2025-07-22T15:39:27.071Z","avatar_url":"https://github.com/sinistersnare.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Robson Traversal #\n\nHey y'all, this is a pretty cool tree traversal algorithm I've got here.\nI wrote this for my data-structures class mostly late at night,\nso please feel free to hate my ugly, poorly commented/written code, but feel even ***freer*** to contribute!\n\n## Running ##\n\nThe Robson traversal supports pre-, in-, and pos- order traversals.\n\nThe link inversion traversal supports pre-, in-, and post-order.\n\nThreaded traversals only support in-order processing.\n\n    $ make all # instead of using all the other make commands\n    $ make robson\n    $ ./robson.x -rno 1 2 5 4 7 3 8 10 0 11\n    $ make threaded\n    $ ./threaded.x -rno 1 2 5 4 7 3 8 10 0 11\n    $ make inversion\n    $ ./link_inversion.x -rno 1 2 5 4 7 3 8 10 0 11\n    $ make clean # when you are done.\n\n## TODO: ##\n\n* Blog post on Traversals. Then replace the next section with a link to that.\n* Testing!\n    * Need tests using specific trees, not just random, to make sure certain cases are checked.\n* Warning when no options are given for runner-programs\n\n## Why do I need the Robson traversal? ##\n\nA Robson traversal is a binary tree traversal in `O(n)` time, and ***`O(1)`*** (!!!) space.\n\nThe basic depth-first search traversal algorithm is `O(n)` space, and the threaded and link-inversion methods both are also `O(n)` space complexity.\n\nThe Robson traversal takes the best of the link-inversion and threaded methods to create an `O(1)` space algorithm.\n\n## Helpful links ##\n\nThere is very little information on the internet for this algorithm, so I hope that the core\nalgorithm in `robson.c` is annotated enough to give an idea of its core process.\n\nI am currently writing a blog post about Robson and the other traversals in this repository,\nso please stay tuned on https://drs.is for that!\n\nI included the paper by JM Robson here (algorithm written in ALGOL 68-R!!).\nIt is relatively hard to get a copy of it, so I decided its worth it to include.\n\nHere are some of the resources I found helpful when studying the Robson Traversal:\n\n* **(PDF warning) [Temple University lecture slides](https://cis.temple.edu/~wolfgang/cis551/Week06.pdf)**\n\nThis was a really important link for me, after lots of studying their C++ algorithm and their example images,\nI figured out how to do it with much less dumb OOP stuff.\n\n* **Data Structures, Algorithms and Program Style Using C by James F. Korsh and Leonard J. Garrett, Chapter 13.6.3 Robson Traversal**\n    * available\n[online](http://mindfulintegrations.com/books/Technology/computer_science/algo/start.htm)\nor on [amazon](https://www.amazon.com/Structures-Algorithms-Program-Style-Using/dp/087150099X)\n\nThis was also extremely helpful, but again did not give the whole picture. The example starts in the middle of a traversal, and the text is unhelpful without extremely careful scrutiny.\n\nBoth of these resources were helpful in the end, and I'm glad I was able to divine a somewhat understandable solution thanks to these.\n\n## License ##\n\nThis code is licensed with the MIT License! Please check LICENSE.md for more info!\n\n## Special Thanks ##\n\nThank you Jason Filippou for telling me about this cool algorithm. UMCP students take his classes!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinistersnare%2Frobson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinistersnare%2Frobson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinistersnare%2Frobson/lists"}