{"id":15713616,"url":"https://github.com/olegchuev/grokking-algorithms","last_synced_at":"2026-05-09T04:33:24.145Z","repository":{"id":179533197,"uuid":"663628712","full_name":"OlegChuev/grokking-algorithms","owner":"OlegChuev","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-23T18:35:15.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T18:46:58.446Z","etag":null,"topics":["algorithms","crystal-lang","python","ruby"],"latest_commit_sha":null,"homepage":"","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/OlegChuev.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":"2023-07-07T18:35:55.000Z","updated_at":"2023-07-07T18:42:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"3333b8c5-6787-4961-8556-8eacf12e56d2","html_url":"https://github.com/OlegChuev/grokking-algorithms","commit_stats":null,"previous_names":["olegchuev/grokking-algorithms"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlegChuev%2Fgrokking-algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlegChuev%2Fgrokking-algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlegChuev%2Fgrokking-algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlegChuev%2Fgrokking-algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OlegChuev","download_url":"https://codeload.github.com/OlegChuev/grokking-algorithms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246365638,"owners_count":20765546,"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","crystal-lang","python","ruby"],"created_at":"2024-10-03T21:32:31.205Z","updated_at":"2026-05-09T04:33:24.095Z","avatar_url":"https://github.com/OlegChuev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grokking Algorithms\n\nThe main idea of the repo is to go through Grokking Algorithms book  by Aditya Y. Bhargava.\n\nLanguages:\n* Python\n* Ruby\n* Crystal\n\n---\n\n### #1 - Binary search\n\n#### Complexity\n\n`O log(n)`\n\n1.1) If you have a sorted list of 128 names and you are searching for a value in it using the binary search method, what is the maximum number of comparisons that may be required?\n\nAnswer: log2(128) =\u003e 7\n\n1.2) Assuming the size of the list doubled, how will the maximum number of comparisons change?\n\nAnswer: log2(256) =\u003e 8\n\n1.3) Given the surname, you need to find the phone number in the phone book.\n\nAnswer: O(log n)\n\n1.4) Given the phone number, you need to find the surname in the phone book.\n\nAnswer: O(n)\n\n1.5) You need to read the phone numbers of all people in the phone book.\n\nAnswer: O(n)\n\n1.6) You need to read the phone numbers of all people whose surnames start with the letter.\n\nAnswer: O(n)\n\n---\n\n### #2 - Selection sort\n\n#### Complexity\n\n`O(n^2)`\n\n### #3 - Quick sort\n\n#### Complexity\n\n`O(n*log(n))`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folegchuev%2Fgrokking-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folegchuev%2Fgrokking-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folegchuev%2Fgrokking-algorithms/lists"}