Skip to main content

Questions tagged [trie]

A tree-like data structure used to hold an associative array, also called a Prefix Tree.

3votes
1answer
84views

Autocompletion trie for English words in zig

I am trying to write a program that creates a Trie from a list of all English words, and then when run provides completions for a given prefix. Basically for each node I allocate a list of 255 null ...
Joe Liotta's user avatar
4votes
1answer
174views

Trie implementation using std::shared_ptr

I've implemented a basic Trie that is supposed to work only with lowercase English letters. ...
csmathhc's user avatar
5votes
1answer
137views

Trie Implementation, Graph Visualization and Auto-Completion in C

Given a list of strings (say a text file containing some C symbols: c-symbols.txt), the program can: Generate a graph of the underlying trie (-p/--prefix can be specified to inspect a specific prefix ...
Madagascar's user avatar
8votes
3answers
959views

Simple tree dictionary structure in C

I have developed a C library whose goal is to store strings in an easily searchable tree structure (which I have dubbed tree-dictionary). I come from a math background and I have been coding in Python ...
francescoriccardocrescenzi's user avatar
4votes
1answer
123views

Autocomplete system with prefix tree

I am quite new to Haskell, and this problem is from dailycodingproblem.com: Implement an autocomplete system. That is, given a query string s and a set of all ...
Fin H's user avatar
0votes
2answers
99views

Trie Data Structure in R7RS Scheme

Making the transition from R6RS Scheme to R7RS has been very educational and fun. Chibi Scheme is my favorite because of its close compliance with the standard. When starting a new project, I wanted ...
clartaq's user avatar
3votes
1answer
133views

Exceeded time limit on Trie search with Backtracking using Swift

I have been trying to solve Trie related problems over at leet code and came across this interesting problem 211. Design Add and Search Words Data Structure Here is the question for convenience: 211. ...
Shawn Frank's user avatar
5votes
2answers
596views

Leet Code 139 (Word Break) using a trie with recursion

I was attempting to solve LeetCode 139 - Word Break Given a string s and a dictionary of strings wordDict, return ...
Shawn Frank's user avatar
2votes
1answer
207views

Trie data structure in Swift lang

This is an implementation of a generic Trie DS, in Swift-lang, that is using however, for the sake of a easy example, strings. It implements two operations, insert and search. So it can insert a text, ...
Dan's user avatar
  • 175
3votes
1answer
288views

Lock-free, thread-safe trie container

This is a Trie data structure for mapping strings to integers or pointers in O(n) time. Based on the idea that we never delete anything from the container, we can perform concurrent read/write ...
CaptainCodeman's user avatar
0votes
1answer
165views

Sorting in linear time using Trie Data Structure

I have written an article on a new way of non comparison sorting and I want it to get peer reviewed. The sorting algorithm uses Trie data structure to store digits of numbers as nodes and iterating ...
Jomy Sebastian's user avatar
1vote
1answer
217views

Comparing a prefix tree against a HashSet of strings in Java

Here, I have made an attempt to find out whether a prefix tree is any more efficient than a simple java.util.HashSet<String>. See what I have: ...
coderodde's user avatar
3votes
1answer
100views

Building a trie from a vector of strings in Rust

I'm learning rust (coming from C++) and playing around with different small algorithms to understand the ownership & borrowing concepts better. Currently, I'm having difficulties finding the ...
picklepick's user avatar
4votes
1answer
97views

LetterDict, a dictionary whose keys must be lowercase letters [a-z]

Looking for any suggestions - alternative design, improvements to readability, improvements to the comments, etc. I implemented this letter dictionary to see if it would faster than a regular ...
joseville's user avatar
8votes
1answer
2kviews

Radix Tree Implementation in c

I tried implementing a radix tree using C language in order to get the auto complete suggestions of a dictionary. What are the improvements that I can do here? Also, is there any better way of doing ...
rusiru thushara's user avatar

153050per page
close