https://github.com/lovesaroha/ltries
This is a generalized tries package with clean and transparent API for the Go language.
https://github.com/lovesaroha/ltries
golang package tries
Last synced: 7 months ago
JSON representation
This is a generalized tries package with clean and transparent API for the Go language.
- Host: GitHub
- URL: https://github.com/lovesaroha/ltries
- Owner: lovesaroha
- License: gpl-3.0
- Created: 2021-09-15T09:38:16.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-26T12:23:47.000Z (about 4 years ago)
- Last Synced: 2025-01-12T19:23:22.192Z (9 months ago)
- Topics: golang, package, tries
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ltries
This is a generalized tries package with clean and transparent API for the Go language.## Features
- Lightweight and Fast.
- Native Go implementation.
- Support all utf-8 (characters).## Requirements
- Go 1.9 or higher. We aim to support the 3 latest versions of Go.## Installation
Simple install the package to your [$GOPATH](https://github.com/golang/go/wiki/GOPATH "GOPATH") with the [go tool](https://golang.org/cmd/go/ "go command") from shell:
```bash
go get -u github.com/lovesaroha/ltries
```
Make sure [Git is installed](https://git-scm.com/downloads) on your machine and in your system's `PATH`.## Usage
### Create Trie
```Golang
// Create a trie.
trie := ltries.Create()// Insert words in trie with index.
trie.Insert("love", 1)
trie.Insert("saroha", 2)
trie.Insert("git", 3)// To find index of given word (if not found return -1).
index := trie.Get("love")// Remove given word from trie.
trie.Remove("git")```