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

learn more… | top users | synonyms

4
votes
2answers
135 views

Trie (tree form) in Java

I created a Java Trie as part of a project someone challenged me to do. I'm not sure that this is the most efficient way to go about producing a Trie, I know that this works but I was hoping someone ...
1
vote
1answer
339 views

Trie - code review request for improvement

Ok, code reviewers, I want you to pick my code apart and give me some feedback on how I could make it better or more simple. ...
3
votes
2answers
80 views

Improving Trie Implementation

This is an implementation of a trie, that I will be using on a code editor to parse keywords from a given programming language. I decided to use a trie when I asked this question, and the ...
2
votes
1answer
478 views

Next word prediction using n-grams. How can I correctly use equals and compareto methods

Hello I have written following program for next word prediction using n-grams. The data structure is like a trie with frequency of each word. Here is the code, any suggestions are welcome but I am ...
7
votes
1answer
611 views

Simple trie implementation in JavaScript

After experimenting with a sorted trie implementation in C, I felt that I understood tries pretty well, but was having trouble explaining how they work. Since the C code was based on existing code, I ...
1
vote
1answer
130 views

Sorted trie implementation in C

I wanted to store some dictionary data (key/value pairs of strings) in C, and decided to use a trie. I found what looks like a good implementation here, along with some nice notes. In this ...
8
votes
3answers
489 views

Readability and Performance of my Trie implementation

As an interesting exercise in Python 3.3, I implemented a Trie (also known as a Prefix Tree). Example usages Create from list of key-value-tuples ...
3
votes
1answer
195 views

delete a key in a trie

To delete a key from a trie, there are four cases: For the explanation of trie data structure, please check the following link: http://www.geeksforgeeks.org/trie-insert-and-search/ (1) Key is not in ...
1
vote
1answer
238 views

Is this a valid implementation of trie Data structure?

i am trying to learn Trie Data Structure and just implemented it without giving much attention to the code standards , its a raw implementation , can you guys help me to understand whether this ...
8
votes
2answers
6k views

c++ implementation of Trie data structure

I use Trie data structure to solve the following problem: Given an array of words, print all anagrams together. For example, if the given array is {“cat”, “dog”, “tac”, “god”, “act”}, then ...
0
votes
1answer
259 views

use trie data structure to solve the problem of clustering anagrams

Given an array of words, print all anagrams together. For example, if the given array is {“cat”, “dog”, “tac”, “god”, “act”}, then output may be “cat tac act dog god”. The following is my c++ ...
6
votes
1answer
2k views

A trie implementation for left to right wild card search

I was working on a task to implement auto suggest from an array of couple of thousands of strings. Ofcourse the first and the easiest implementable was to go through each element and do ...