{"id":22547678,"url":"https://github.com/rohittcodes/data-structures","last_synced_at":"2025-06-29T16:32:33.650Z","repository":{"id":234041881,"uuid":"752236282","full_name":"rohittcodes/data-structures","owner":"rohittcodes","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-03T12:46:14.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T22:45:11.493Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rohittcodes.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}},"created_at":"2024-02-03T12:44:58.000Z","updated_at":"2024-02-03T12:46:17.000Z","dependencies_parsed_at":"2024-04-18T02:49:52.117Z","dependency_job_id":null,"html_url":"https://github.com/rohittcodes/data-structures","commit_stats":null,"previous_names":["rohittcodes/data-structures"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohittcodes%2Fdata-structures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohittcodes%2Fdata-structures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohittcodes%2Fdata-structures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohittcodes%2Fdata-structures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rohittcodes","download_url":"https://codeload.github.com/rohittcodes/data-structures/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245999594,"owners_count":20707568,"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":[],"created_at":"2024-12-07T15:12:36.318Z","updated_at":"2025-03-28T09:12:05.176Z","avatar_url":"https://github.com/rohittcodes.png","language":"C++","readme":"\u003c!-- Prefix Evaluation --\u003e\n\n*+-/*326414\n\n1. Iterate through the end of string\n2. Check if the string char is a number or an operator. Make the char a number by using ascii and then push.\n   If it's an operator pop top two numbers from stack and perform the operation using switch cases and push the result.\n3. If the string ends then just display the result you got.\n\n\u003c!-- Postfix evaluation --\u003e\n\n1. Iterate through the end of string\n2. Check if the string\n\n\u003c!-- Infix to prefix --\u003e\n\n1. If operand print it\n2. If '(' then push on to stack\n3. If operator, check precedence and if the precedence is higher than the top, push it else pop out the\n\n\u003c!-- Infix to postfix --\u003e\n\n1. If operand print it\n2. If '(' then push onto stack\n3. If operator, check precendence and if the precedence is higher than the top, push it else pop until the stack becomes empty ir the top element gas kess precedence.\n4. If ')' then check the top od the stack and keep poppinf it unless you don't encounter '('. pop out the ( and repeat the process.\n   Once you reach at the end of the string pop out everything from the stack.\n   Examples:\n   Infix: (a+b)/((c*d)-e) || postfix: ab+cd*e-/\n   Infix: (a-b)/(c+d)-e || postfix: ab-cd+\\*e-\n   Infix: (a/b)/(c+d)-(e+f) || postfix: ab/cd+ef+-/\n\n\u003c!-- Infix to prefix --\u003e\n\nExample: (a-b/c)\\*(a/k-l)\n\n1. Reverse the string\n2. Convert the ')' to '('and vice versa (l-k/a)\\*(c/b-a)\n3. Repeat the algo for postfix\n4. Reverse the answer.\n\n\u003c!-- Queue using stacks (Expensive approach -\u003e enqueue)--\u003e\n\nUse two stacks\n\n1. Empty all elements from s1 to s2\n2. Push the new element to s1\n3. Pop each element from s2 and push it into s1\n4. To print or dequeue, pop out every element from s1\n\n\u003c!-- Queue using stacks (Expensive approach -\u003e dequeue)  --\u003e\n\nUse two empty stacks\n\n1. Pop all the elements from s1 and push it in s2\n2. Pop all the elements from s2\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohittcodes%2Fdata-structures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohittcodes%2Fdata-structures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohittcodes%2Fdata-structures/lists"}