Data structures: trie (Trie tree)

I. Introduction

Data structure is internal strength, external work algorithm is only solid data structure can be done better functionality through different data structure elements scheduling algorithm

 

Trie (Trie tree), also known as trie is a tree structure, a variation on the hash tree.

Statistics used in sorting and saving a lot of strings (strings are not limited to), the system used by search engines to retrieve the text string text word frequency statistics spell checker automatically detect

Its advantage is the use of the common prefix string to reduce the query time, minimizing unnecessary string comparison, high efficiency query tree Bi Haxi

 

It has three basic properties:

(1) does not contain character root node, each node except the root node contains only outside a character

(2) from the root node to a node on the path through the stitching together the character string corresponding to that node

(3) all the characters of each node comprising a child node is not the same

 

 

II. To achieve

 

Guess you like

Origin www.cnblogs.com/k5bg/p/11103893.html