{"id":25684693,"url":"https://github.com/ediloaz/bst-dynamic-vs-bst-greedy","last_synced_at":"2026-04-28T00:32:00.952Z","repository":{"id":116434626,"uuid":"143640527","full_name":"ediloaz/BST-Dynamic-vs-BST-Greedy","owner":"ediloaz","description":"Finds the BST optimal using a dynamic and a greedy algorithm. Analyze both trees and processing time of the solution (on Latex document).","archived":false,"fork":false,"pushed_at":"2018-08-06T03:27:29.000Z","size":1009,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-21T18:09:57.379Z","etag":null,"topics":["binary-search-tree","bstree","c","comparative-analysis","dynamic-programming","greedy-algorithms","linux","operations-research"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ediloaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2018-08-05T19:08:07.000Z","updated_at":"2018-08-06T03:31:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"614c4b59-136c-489f-83e0-119749efdc4a","html_url":"https://github.com/ediloaz/BST-Dynamic-vs-BST-Greedy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ediloaz/BST-Dynamic-vs-BST-Greedy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ediloaz%2FBST-Dynamic-vs-BST-Greedy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ediloaz%2FBST-Dynamic-vs-BST-Greedy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ediloaz%2FBST-Dynamic-vs-BST-Greedy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ediloaz%2FBST-Dynamic-vs-BST-Greedy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ediloaz","download_url":"https://codeload.github.com/ediloaz/BST-Dynamic-vs-BST-Greedy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ediloaz%2FBST-Dynamic-vs-BST-Greedy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32361477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["binary-search-tree","bstree","c","comparative-analysis","dynamic-programming","greedy-algorithms","linux","operations-research"],"created_at":"2025-02-24T17:32:27.791Z","updated_at":"2026-04-28T00:32:00.947Z","avatar_url":"https://github.com/ediloaz.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BST Dynamic vs BST Greedy\n\nThis program was created as part of an evaluation of a bachelor course in engineering. Resolves and find the optimal BST (Binary Search Tree) using two algorithms:\n* Dynamic Algorithm ([about this](https://en.wikipedia.org/wiki/Dynamic_algorithm))\n* Greedy Algorithm ([about this](https://en.wikipedia.org/wiki/Greedy_algorithm))\n\nBoth were programmed in C on Linux, the main purpose was not to find the tree, but to make a comparison between these two algorithms taking the time and the \"correct solution\" factors.\n\n## Input\n\nIs on the Linux terminal, not has a interface, the user can use two different ways:\n* Example mode\n* Experiment mode\n\n### Example mode\n\nGenerate and solve a single random case with the two algorithms. The execution of the program generates a latex document where it specifies the initial problem, the response with the greedy algorithm, the response with the dynamic programming algorithm (both with their respective tables) and the conclusions reached in that execution.\n\nThe input must will be:\n```\n./program -X\n```\n\n![Screenshot of the terminal in Example mode](https://github.com/ediloaz/BST-Dynamic-vs-BST-Greedy/blob/master/settings/input-example.png)\n\n\n\n### Experiment mode\n\nGenerates and solves N random cases, collects statistical data. The execution of the program generates a latex document where it specifies the amount of data that will be used, the time tables of both algorithms, as well as an additional one which shows the percentage of optimal responses produced by the Greedy algorithm.\n\nThe input must will be:\n```\n./program -E=N\n```\nWhere the \"N\" parameter is the number of **N\\*10 random cases** that you want.\n\n\n![Screenshot of the terminal in Experiment mode](https://github.com/ediloaz/BST-Dynamic-vs-BST-Greedy/blob/master/settings/input-experiment.png)\n\n\n## Output\n\nA .tex file (and others files required) will create and convert to pdf with *pdflatex command*  and will open with *evince command*. All these files are saved in **output** folder. And each mode create a different document structure.\n\n\n### Example mode\n\n![Screenshot of an example of Example mode](https://github.com/ediloaz/BST-Dynamic-vs-BST-Greedy/blob/master/settings/Example-1.jpg)\n\n![Screenshot of an example of Example mode](https://github.com/ediloaz/BST-Dynamic-vs-BST-Greedy/blob/master/settings/Example-2.jpg)\n\n\n\n### Experiment mode\n\n![Screenshot of the Experiment mode](https://github.com/ediloaz/BST-Dynamic-vs-BST-Greedy/blob/master/settings/Experiment-1.jpg)\n\n\n\n\n## Prerequisites\n\nIt is necessary to have installed *latex* (including *pdflatex*), *pkg-config* and *evince* in your linux. You can install it with the following commands:\n```\nsudo apt-get install texlive-full\n```\n```\nsudo apt-get install texmaker\n```\n```\nsudo apt-get install evince\n```\n```\nsudo apt install pkg-config\n```\n\n## Running\n\nFirst is necessary compile the main file (*main.c*) with the command\n```\n gcc -o program main.c\n```\n\nand then it can be opened\n```\n./program\n```\n\n## Built With\n\n* [Sublime text](https://www.sublimetext.com/3)\n\n\n## Authors\n\n* **Edisson López** - *Main developer* - [ediloaz](https://github.com/ediloaz)\n\nSee also the list of [repositories](https://github.com/ediloaz?tab=repositories) who I participated/created.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fediloaz%2Fbst-dynamic-vs-bst-greedy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fediloaz%2Fbst-dynamic-vs-bst-greedy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fediloaz%2Fbst-dynamic-vs-bst-greedy/lists"}