ghchoi
ghchoi

Reputation: 5156

Data Structure: Dictionary Like Tree

I think I've heard that there is data structure something like tree to store dictionary entries.

It may look like:

c ┬ a ┬ b
   │     ├ r
   │     ├ s ─ e
   │     └ t
   ├ i ─ ...
   :

Is there any name for this data structure?

I cannot find it...

Thanks for your help, thank you in advance!

Upvotes: 0

Views: 1631

Answers (1)

Bernhard Barker
Bernhard Barker

Reputation: 55599

A trie might be what you're looking for.

A trie, also called digital tree and sometimes radix tree or prefix tree ..., is a kind of search tree - an ordered tree data structure that is used to store a dynamic set or associative array where the keys are usually strings. ... [A node's] position in the tree defines the key with which it is associated. All the descendants of a node have a common prefix of the string associated with that node...

A trie for keys "A","to", "tea", "ted", "ten", "i", "in", and "inn".

Upvotes: 2

Related Questions