{"id":15791450,"url":"https://github.com/dhravya/dsa-for-noobs","last_synced_at":"2025-03-31T18:48:44.936Z","repository":{"id":108028357,"uuid":"446104005","full_name":"Dhravya/DSA-for-noobs","owner":"Dhravya","description":"A collection of data structures and algorithms I'm writing while learning ","archived":false,"fork":false,"pushed_at":"2022-01-09T18:40:53.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-11T23:05:06.436Z","etag":null,"topics":["algorithms","data-structures"],"latest_commit_sha":null,"homepage":"https://dhravya.me","language":"Python","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/Dhravya.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}},"created_at":"2022-01-09T13:59:41.000Z","updated_at":"2024-03-04T04:50:33.000Z","dependencies_parsed_at":"2023-03-13T14:29:27.488Z","dependency_job_id":null,"html_url":"https://github.com/Dhravya/DSA-for-noobs","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/Dhravya%2FDSA-for-noobs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dhravya%2FDSA-for-noobs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dhravya%2FDSA-for-noobs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dhravya%2FDSA-for-noobs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dhravya","download_url":"https://codeload.github.com/Dhravya/DSA-for-noobs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246523890,"owners_count":20791443,"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":["algorithms","data-structures"],"created_at":"2024-10-04T23:00:55.795Z","updated_at":"2025-03-31T18:48:44.905Z","avatar_url":"https://github.com/Dhravya.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Structures and Algorithms:\n\nThis is a collection of data structures and algorithms that I write while learning the subject\n\n## Stack:\nstack.py\nA stack algorithm is a data structure that is like a pack of cards - a stack.\nStack has the following properties:\n\n### Push\nAdds element to the top of the stack\n\n### Pop\nRemoves element from the top of the stack\n\n### Peek\nReturns the element at the top of the stack\n\nSize and is_empty are just helper functions \n\n### Stuff Done with stack:\n- Checking if a bracket string is balanced\n    Explanation:\n    - Add all brackets in the stack one by one\n    - on reaching a closing bracket, check if the top of the stack is a matching bracket\n    - if it is, pop the top of the stack and check the next bracket\n    - rinse and repeat \n    - if the stack is empty, the string is balanced\n    - otherwise, the string is not balanced in the end\n\n- Reverse algorithm\n    Explanation:\n    - Add all characters in the string to the stack\n    - make a new string - which will hold the return value\n    - pop the top of the stack until its empty and add it to the string\n    - Voila! the string has been reversed\n\n- Int to binary conversion\n    Explanation:\n    - Divide the integer by 2 and add the remainder to the stack\n    - the quotient obtained from the division is what we'll use to get the next remainder\n    - Keep repeating until the quotient is 0\n    - Reverse the stack by popping its values to obtain the binary string\n    ```\n        ___________________________\n        |Quotient: 2 Remainder: 1  | - remainder added (Current stack: 1)\n        |Quotient: 1 Remainder: 0  | - remainder added (Current stack: 10)\n        |Quotient: 0 Remainder: 1  | - remainder added (Current stack: 101)\n        ____________________________\n        Answer will be the reverse of this stack : 101\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhravya%2Fdsa-for-noobs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhravya%2Fdsa-for-noobs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhravya%2Fdsa-for-noobs/lists"}