{"id":20944445,"url":"https://github.com/amoshnin/cs.python-datastructures.algorithms","last_synced_at":"2025-09-11T07:35:10.022Z","repository":{"id":106312367,"uuid":"442777586","full_name":"amoshnin/CS.Python-DataStructures.Algorithms","owner":"amoshnin","description":"📘 List of (Algorithms, Data Structures \u0026 Coding Problems) 🐍 Implemented in Python with detailed explanations and links to further readings | Preparation for coding interviews 🚀","archived":false,"fork":false,"pushed_at":"2021-12-29T14:11:43.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T04:16:30.855Z","etag":null,"topics":["algorithms","coding-problems","data-structures"],"latest_commit_sha":null,"homepage":"","language":null,"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/amoshnin.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}},"created_at":"2021-12-29T13:15:22.000Z","updated_at":"2021-12-29T14:21:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"ecf0f6a3-91a9-4501-965b-f7fd7066b88d","html_url":"https://github.com/amoshnin/CS.Python-DataStructures.Algorithms","commit_stats":null,"previous_names":["amoshnin/cs.python-datastructures.algorithms"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amoshnin/CS.Python-DataStructures.Algorithms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amoshnin%2FCS.Python-DataStructures.Algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amoshnin%2FCS.Python-DataStructures.Algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amoshnin%2FCS.Python-DataStructures.Algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amoshnin%2FCS.Python-DataStructures.Algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amoshnin","download_url":"https://codeload.github.com/amoshnin/CS.Python-DataStructures.Algorithms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amoshnin%2FCS.Python-DataStructures.Algorithms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274595470,"owners_count":25314017,"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-09-11T02:00:13.660Z","response_time":74,"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":["algorithms","coding-problems","data-structures"],"created_at":"2024-11-18T23:42:17.907Z","updated_at":"2025-09-11T07:35:09.984Z","avatar_url":"https://github.com/amoshnin.png","language":null,"readme":"# Data Structures and Algorithms\n\nby Artem Moshnin as part of my studies of Computer Science Degree\n\n## Data Structures\n\nA data structure is a particular way of organizing and storing data in a computer so that it can\nbe accessed and modified efficiently. More precisely, a data structure is a collection of data\nvalues, the relationships among them, and the functions or operations that can be applied to\nthe data.\n\n`B` - Beginner, `A` - Advanced\n\n- `B` [Linked List](src/data-structures/linked-list)\n\n## Algorithms\n\nAn algorithm is an unambiguous specification of how to solve a class of problems. It is\na set of rules that precisely define a sequence of operations.\n\n`B` - Beginner, `A` - Advanced\n\n### Algorithms by Topic\n\n- **Strings**\n  - `A` [Levenshtein Distance](src/algorithms/string/levenshtein-distance) - minimum edit distance between two sequences\n\n## Useful Information\n\n### References\n\n[▶ Data Structures and Algorithms on YouTube](https://www.youtube.com/playlist?list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)\n\n### Big O Notation\n\n_Big O notation_ is used to classify algorithms according to how their running time or space requirements grow as the input size grows.\nOn the chart below you may find most common orders of growth of algorithms specified in Big O notation.\n\n![Big O graphs](./assets/big-o-graph.png)\n\nSource: [Big O Cheat Sheet](http://bigocheatsheet.com/).\n\nBelow is the list of some of the most used Big O notations and their performance comparisons against different sizes of the input data.\n\n| Big O Notation | Computations for 10 elements | Computations for 100 elements | Computations for 1000 elements |\n| -------------- | ---------------------------- | ----------------------------- | ------------------------------ |\n| **O(1)**       | 1                            | 1                             | 1                              |\n| **O(log N)**   | 3                            | 6                             | 9                              |\n| **O(N)**       | 10                           | 100                           | 1000                           |\n| **O(N log N)** | 30                           | 600                           | 9000                           |\n| **O(N^2)**     | 100                          | 10000                         | 1000000                        |\n| **O(2^N)**     | 1024                         | 1.26e+29                      | 1.07e+301                      |\n| **O(N!)**      | 3628800                      | 9.3e+157                      | 4.02e+2567                     |\n\n### Data Structure Operations Complexity\n\n| Data Structure         | Access | Search | Insertion | Deletion | Comments                                             |\n| ---------------------- | :----: | :----: | :-------: | :------: | :--------------------------------------------------- |\n| **Array**              |   1    |   n    |     n     |    n     |                                                      |\n| **Stack**              |   n    |   n    |     1     |    1     |                                                      |\n| **Queue**              |   n    |   n    |     1     |    1     |                                                      |\n| **Linked List**        |   n    |   n    |     1     |    n     |                                                      |\n| **Hash Table**         |   -    |   n    |     n     |    n     | In case of perfect hash function costs would be O(1) |\n| **Binary Search Tree** |   n    |   n    |     n     |    n     | In case of balanced tree costs would be O(log(n))    |\n| **B-Tree**             | log(n) | log(n) |  log(n)   |  log(n)  |                                                      |\n| **Red-Black Tree**     | log(n) | log(n) |  log(n)   |  log(n)  |                                                      |\n| **AVL Tree**           | log(n) | log(n) |  log(n)   |  log(n)  |                                                      |\n| **Bloom Filter**       |   -    |   1    |     1     |    -     | False positives are possible while searching         |\n\n### Array Sorting Algorithms Complexity\n\n| Name               |     Best      |         Average         |            Worst            | Memory | Stable | Comments                                                      |\n| ------------------ | :-----------: | :---------------------: | :-------------------------: | :----: | :----: | :------------------------------------------------------------ |\n| **Bubble sort**    |       n       |      n\u003csup\u003e2\u003c/sup\u003e      |        n\u003csup\u003e2\u003c/sup\u003e        |   1    |  Yes   |                                                               |\n| **Insertion sort** |       n       |      n\u003csup\u003e2\u003c/sup\u003e      |        n\u003csup\u003e2\u003c/sup\u003e        |   1    |  Yes   |                                                               |\n| **Selection sort** | n\u003csup\u003e2\u003c/sup\u003e |      n\u003csup\u003e2\u003c/sup\u003e      |        n\u003csup\u003e2\u003c/sup\u003e        |   1    |   No   |                                                               |\n| **Heap sort**      | n\u0026nbsp;log(n) |      n\u0026nbsp;log(n)      |        n\u0026nbsp;log(n)        |   1    |   No   |                                                               |\n| **Merge sort**     | n\u0026nbsp;log(n) |      n\u0026nbsp;log(n)      |        n\u0026nbsp;log(n)        |   n    |  Yes   |                                                               |\n| **Quick sort**     | n\u0026nbsp;log(n) |      n\u0026nbsp;log(n)      |        n\u003csup\u003e2\u003c/sup\u003e        | log(n) |   No   | Quicksort is usually done in-place with O(log(n)) stack space |\n| **Shell sort**     | n\u0026nbsp;log(n) | depends on gap sequence | n\u0026nbsp;(log(n))\u003csup\u003e2\u003c/sup\u003e |   1    |   No   |                                                               |\n| **Counting sort**  |     n + r     |          n + r          |            n + r            | n + r  |  Yes   | r - biggest number in array                                   |\n| **Radix sort**     |    n \\* k     |         n \\* k          |           n \\* k            | n + k  |  Yes   | k - length of longest key                                     |\n\n\u003cdetails\u003e\n  \u003csummary\u003eTime/Space complexity for for Data Structure Operations\u003c/summary\u003e\n    \u003cbr/\u003e\n    \u003cimg src=\"https://i.ibb.co/nPzw2nY/image.png\" /\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eTime/Space complexity for Array Sorting Algorithms\u003c/summary\u003e\n    \u003cbr/\u003e\n    \u003cimg src=\"https://i.ibb.co/xCH9sSC/image.png\" /\u003e\n\u003c/details\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famoshnin%2Fcs.python-datastructures.algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famoshnin%2Fcs.python-datastructures.algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famoshnin%2Fcs.python-datastructures.algorithms/lists"}