{"id":16742367,"url":"https://github.com/urtuba/algorithms_with_python","last_synced_at":"2025-10-25T13:38:59.437Z","repository":{"id":127188650,"uuid":"232414967","full_name":"urtuba/algorithms_with_python","owner":"urtuba","description":"sorting, searching etc...","archived":false,"fork":false,"pushed_at":"2020-01-11T09:07:48.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T23:39:35.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/urtuba.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":"2020-01-07T20:51:18.000Z","updated_at":"2020-01-11T09:07:50.000Z","dependencies_parsed_at":"2023-08-15T09:30:49.175Z","dependency_job_id":null,"html_url":"https://github.com/urtuba/algorithms_with_python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/urtuba/algorithms_with_python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urtuba%2Falgorithms_with_python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urtuba%2Falgorithms_with_python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urtuba%2Falgorithms_with_python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urtuba%2Falgorithms_with_python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urtuba","download_url":"https://codeload.github.com/urtuba/algorithms_with_python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urtuba%2Falgorithms_with_python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280965081,"owners_count":26421547,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-13T01:23:33.390Z","updated_at":"2025-10-25T13:38:59.433Z","avatar_url":"https://github.com/urtuba.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# algorithms_with_python\n\nThis project is coding for implementing and testing algorithms in python. Functions are written briefly, helper functions are added beside algorithms.\n\n## tester.py\n\nThis main file acts as command line program for testing and using algorithms. You can easily test different sorting algorithms without any coding using this file.\n\n## sorting.py\n\nFile contains sorting algorithms.\n\n### insertion_sort\n\n1. start from second element of the list\n1. compare with other elements backwards\n  - if you found smaller elements after greater elements, position your element after it\n  - if you found all items are smaller than yours, keep it in its current position\n1. do this process for every element from second to last\n\nInsertion sort is inefficient algorithm when input size and complexity goes greater.\n\n**best case:** ordered list\n\n**worst case:** reverse ordered list\n\n**time complexity:** O(n\u003csup\u003e2\u003c/sup\u003e)\n\n**space complexity:** O(1)\n\n### reverse_insertion_sort\n\nThis is simply reversed *insertion_sort*, I did not implement it separately yet.\n\n### merge_sort\n\n1. divide list by two until obtain 1-sized lists\n1. merge two arrays recursively to obtain sorted list\n  - compare first elements of array\n  - take smaller element and continue comparison with next element for that array whose element is used.\n\n**best case = average case = worst case**\n\n**time complexity:** O(n*lg* n)\n\n**space complexity:** O(1)\n\n\n### quick_sort\n\n1. select a pivot\n1. divide list into three subtrees as equal to pivot, greater than pivot, smaller than pivot\n1. do this process recursively for greater and smaller lists that created until 1-sized lists.\n\n**time complexity:** O(n*lg*n)\n\n**space complexity:** O(1)\n\n\n\n### counting_sort\n1. create an counter array from 0 to max(array)\n1. count each element in list in corresponding index of counter array\n1. apply cummulative summation to the counter array\n1. now counter array shows us new positions of elements in original list, create original list.\n\n**time complexity:** O(n)\n\n**space complexity:** O(n)\n\n\n## helper_functions.py\n\nThis file contains necessary functions while working on algorithms.\n\n### random_array(size, max)\n\nCreates a array of random elements in the range from 0 to *max* with *size* length. As default, if you do not specify max; function produces numbers from *0* to *size*3*. If you do not specify size also, it is set to 20.\n\n### print_array(array)\n\nIt is all for printing a readable version of the array, especially size goes larger it shows its difference.\n\n### test_algorithm(func, size, max)\n\n*size* and *max* are the variables in *random_array* function. *func* argument is the name of function. It creates an array in given size and property, it calls given function then tests its execution time. By doing this, it also provides readable result analysis.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furtuba%2Falgorithms_with_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furtuba%2Falgorithms_with_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furtuba%2Falgorithms_with_python/lists"}