{"id":16874563,"url":"https://github.com/joway/trie","last_synced_at":"2025-08-08T07:21:19.762Z","repository":{"id":57551013,"uuid":"169816258","full_name":"joway/trie","owner":"joway","description":"trie implement for golang","archived":false,"fork":false,"pushed_at":"2019-04-09T10:57:32.000Z","size":59,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T23:18:38.349Z","etag":null,"topics":["golang","trie"],"latest_commit_sha":null,"homepage":"","language":"Go","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/joway.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}},"created_at":"2019-02-09T00:22:08.000Z","updated_at":"2019-02-17T12:03:58.000Z","dependencies_parsed_at":"2022-09-26T18:41:58.215Z","dependency_job_id":null,"html_url":"https://github.com/joway/trie","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/joway/trie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joway%2Ftrie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joway%2Ftrie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joway%2Ftrie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joway%2Ftrie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joway","download_url":"https://codeload.github.com/joway/trie/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joway%2Ftrie/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262293638,"owners_count":23288782,"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":["golang","trie"],"created_at":"2024-10-13T15:33:16.912Z","updated_at":"2025-06-27T16:33:19.881Z","avatar_url":"https://github.com/joway.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trie\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/joway/trie)](https://goreportcard.com/report/github.com/joway/trie)\n[![codecov](https://codecov.io/gh/joway/trie/branch/master/graph/badge.svg)](https://codecov.io/gh/joway/trie)\n[![CircleCI](https://circleci.com/gh/joway/trie.svg?style=shield)](https://circleci.com/gh/joway/trie)\n\n## Usage\n\n### Prefix Search\n\n```go\nimport \"github.com/joway/trie\"\n\ndict := map[string]interface{}{\n\t\t\"/abc\": \"2\",\n\t\t\"/a\":   \"1\",\n\t\t\"/ac\":  \"3\",\n\t\t\"/b\":   \"4\",\n\t\t\"/bc\":  \"5\",\n\t\t\"/bca\": \"6\",\n\t\t\"/ba\":  \"7\",\n\t\t\"/cba\": \"8\",\n}\n\ntree := trie.Build(dict)\n\nprefix, val := tree.PrefixSearchString(\"/a\")\n```\n\n### Prettify Output\n\n```go\noutput := tree.Prettify()\nfmt.Println(output)\n```\n\n```\n*-\u003e/-\u003ea-\u003eb-\u003ec\n||  |  -\u003ec\n||  -\u003eb-\u003ea\n||  |  -\u003ec-\u003ea\n||  -\u003ec-\u003eb-\u003ea\n```\n\n## Document\n\n[GoDoc](https://godoc.org/github.com/joway/trie)\n\n## Benchmark\n\n```\nBenchmarkBuild-8                                    2000            814677 ns/op          555392 B/op       7377 allocs/op\nBenchmarkTrie_AddWord-8                         100000000               12.6 ns/op             0 B/op          0 allocs/op\nBenchmarkTrie_PrefixSearchString-8               5000000               267 ns/op              32 B/op          1 allocs/op\nBenchmarkTrie_PrefixSearch-8                    10000000               156 ns/op               0 B/op          0 allocs/op\n```\n\n### Benchmark Comparison\n\n[https://github.com/derekparker/trie](https://github.com/derekparker/trie) \n\n```\nBenchmarkTrie_AddWord_DTrie-8                   20000000               108 ns/op             112 B/op          2 allocs/op\nBenchmarkTrie_PrefixSearchString_DTrie-8         2000000               732 ns/op             160 B/op          9 allocs/op\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoway%2Ftrie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoway%2Ftrie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoway%2Ftrie/lists"}