{"id":16861995,"url":"https://github.com/maelvls/rbtree-gif","last_synced_at":"2025-03-18T15:55:40.045Z","repository":{"id":79937927,"uuid":"38203930","full_name":"maelvls/rbtree-gif","owner":"maelvls","description":"🎋 Visualize what happens to a red-black tree when nodes are inserted and removed","archived":false,"fork":false,"pushed_at":"2021-01-08T13:54:33.000Z","size":638,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T19:44:04.563Z","etag":null,"topics":["c","dot","rbtree"],"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/maelvls.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-28T15:32:00.000Z","updated_at":"2021-01-24T06:22:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"776a33f5-64db-4bc8-a53a-b6333e5fc0bf","html_url":"https://github.com/maelvls/rbtree-gif","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maelvls%2Frbtree-gif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maelvls%2Frbtree-gif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maelvls%2Frbtree-gif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maelvls%2Frbtree-gif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maelvls","download_url":"https://codeload.github.com/maelvls/rbtree-gif/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244257259,"owners_count":20424127,"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","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":["c","dot","rbtree"],"created_at":"2024-10-13T14:34:14.328Z","updated_at":"2025-03-18T15:55:40.007Z","avatar_url":"https://github.com/maelvls.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Visualization of a red-black tree data structure\n\nThis project aims at visualizing the different rebalancing steps that\nhappen during insertions and deletions in a binary search tree of red-black\ntype. The [rbtree.c](/rbtree.c) contains a simple version of the red-black\ntree data structure, and [main.c](/main.c) is the program that does\ninsertions and deletions step-by-step and then outputs a series of\n[dot](https://graphviz.org/doc/info/lang.html) files which can then be\nconverted into a nice gif using `dot_to_gif.sh`.\n\n`dot_to_gif.sh` was initially meant to help me debug my red-tree\nrebalancing algorithm. It uses `dot` (from\n[graphviz](https://graphviz.org/download/)) and `convert` (from\n[imagemagick](https://imagemagick.org/script/download.php)). The script\ntranslates a series of `.dot` files into a single `.gif` by making a\n~~small~~ readjustment of the nodes so that it looks good. Readjustments\nare made by a script written by [Emden R.\nGansner(stackoverflow)](http://stackoverflow.com/questions/10902745/enforcing-horizontal-node-ordering-in-a-dot-tree).\n\n\nThis project is the result of a home assignment I had for the course \"Data\nStructures\" during my second year of computer science at Université de\nToulouse III - Paul Sabatier. A special thank you to Professor Mathias\nPaulin for his excellent teachings.\n\n![Animation of the behavior of a red-black search tree][gif]\n\n## Instructions for generating the gif\n\nTo test all of this, do:\n\n```sh\nsudo apt install graphviz # Linux\nbrew install graphviz     # macOS\n\nmake\n./rbtree_to_dot -d point -r \"step_\"\n./dot_to_gif.sh $ (find dot -name \"* .dot\" | sort -n -t_ -k2)\n```\n\nThe file `animation.gif` will get generated (similar as to the one above)\ncan be opened! An example of it is displayed at the top of this readme.\n\n[gif]: https://cdn.rawgit.com/maelvalais/comportement-arbre-rouge-noir-avec-dot/a5affb42/exemple_animation.gif\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaelvls%2Frbtree-gif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaelvls%2Frbtree-gif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaelvls%2Frbtree-gif/lists"}