{"id":20419889,"url":"https://github.com/gavindsouza/data-structures-and-design-patterns","last_synced_at":"2026-02-09T11:36:06.524Z","repository":{"id":108890615,"uuid":"512258293","full_name":"gavindsouza/data-structures-and-design-patterns","owner":"gavindsouza","description":"Stuff that I do to scratch an itch","archived":false,"fork":false,"pushed_at":"2024-11-09T11:12:37.000Z","size":14,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T12:03:44.092Z","etag":null,"topics":["data-structures","design-patterns","monad","python","trie"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gavindsouza.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":"2022-07-09T18:28:48.000Z","updated_at":"2024-11-09T11:12:40.000Z","dependencies_parsed_at":"2023-07-15T04:32:22.746Z","dependency_job_id":null,"html_url":"https://github.com/gavindsouza/data-structures-and-design-patterns","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/gavindsouza%2Fdata-structures-and-design-patterns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavindsouza%2Fdata-structures-and-design-patterns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavindsouza%2Fdata-structures-and-design-patterns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavindsouza%2Fdata-structures-and-design-patterns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gavindsouza","download_url":"https://codeload.github.com/gavindsouza/data-structures-and-design-patterns/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248608400,"owners_count":21132721,"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":["data-structures","design-patterns","monad","python","trie"],"created_at":"2024-11-15T06:39:12.962Z","updated_at":"2026-02-09T11:36:06.480Z","avatar_url":"https://github.com/gavindsouza.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Stuff that I do to scratch an itch\n\nImplemented a trie in Python because I've been obsessed with it since I learnt about it first a few years ago. I'll be adding more stuff that I \"feel\" like trying or if I have any newer, better ideas.\n\nBeen learning Rust because it's so cool. Started implementing Trie in Rust and wanted to benchmark while integrating it as a Python module :D That's a wip until I decide to get back to it.\n\n### Contents\n\n1. Trie\n\nA bare bones implementation of Trie using Dict that supports the following operations:\n\n  - Add a word (`str`) to the Trie\n  - Check if word exists in Trie\n  - Generate all words in Trie from a particular node\n\nThe module consists of:\n  - a Python implementation\n  - a Rust equivalent _[wip]_\n\nBenchmarks:\n\nSize of input dictionary: 966,550 words. Size of test dictionary: 10,000 words. Numbers generated using _Python3.10.4_ on _AMD Ryzen 7 PRO_.\n\n| Structure | Inserting dictionary | Full Search | Prefixed Search |\n| - | - | - | - |\n| Trie _(Dict based)_ | 2.18e+00s | 1.19e-02s | 9.88e+00s |\n| Set | 1.11e-01s | 8.28e-04s | 1.26e-03s |\n| List | 2.34e-02s | 4.99+01s | 6.61e+02s |\n\n\u003e The `suggestions.py` script provides a use case for Trie that takes string inputs and give suggestions for similar words if the word/phrase doesn't exist in the data structure.\n\n2. Monad\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavindsouza%2Fdata-structures-and-design-patterns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgavindsouza%2Fdata-structures-and-design-patterns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavindsouza%2Fdata-structures-and-design-patterns/lists"}