https://github.com/andrerav/concurrenttriemap
https://github.com/andrerav/concurrenttriemap
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/andrerav/concurrenttriemap
- Owner: andrerav
- License: mit
- Created: 2022-02-27T22:15:45.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-01T22:35:02.000Z (over 4 years ago)
- Last Synced: 2025-06-29T09:18:06.967Z (about 1 year ago)
- Language: C#
- Size: 44.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ConcurrentTrieMap
## Download
| Package | Link |
| ------- | ---- |
| ConcurrentTrieMap | [](https://www.nuget.org/packages/ConcurrentTrieMap/) |
## Quickstart
```csharp
// Build the trie
CtrieMap ctrie = new CtrieMap();
ctrie.Add("a", 1);
ctrie.Add("ab", 2);
ctrie.Add("abc", 3);
// Return a specific value
ctrie.GetValue("ab"); // Returns 2
// Return a list of tuples (key, values) in the trie starting at the specified prefix
ctrie.GetValues("ab"); // Returns [("ab", 2), ("abc", 3)]
```
## Description
ConcurrentTrieMap is a simple trie map implementation that guarantees thread safety on some basic operations such as adding, deleting and modifying entries in the map. This data structure is optimized for usage in scenarios where fast concurrent prefix lookups are required while still retaining good performance for updating the data structure with new data.