mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-02 06:46:18 -04:00
Update README.md
This commit is contained in:
parent
fd5bbaee8d
commit
fb7059d0e6
1 changed files with 11 additions and 0 deletions
|
@ -3,15 +3,23 @@
|
|||
<br>
|
||||
|
||||
* tries, also called prefix tree, are a variant of n-ary tree in which characters are stored in each node.
|
||||
|
||||
* each trie node represents a string (a prefix) and each path down the tree represents a word. note that not all the strings represented by trie nodes are meaningful.
|
||||
|
||||
* the root is associated with the empty string.
|
||||
|
||||
* the * nodes (null nodes) are often used to indicate complete words (usually represented by a special type of child) or a boolean flag that terminates the parent node.
|
||||
|
||||
* a node can have anywhere from 1 through alphabet_size + 1 child.
|
||||
|
||||
* can be used to store the entire english language for quick prefix lookup (O(k), where k is the length of the string). they are also widely used on autocompletes, spell checkers, and ip routing (longest prefix matching).
|
||||
|
||||
* tries structures can be represented by arrays and maps or trees.
|
||||
|
||||
<br>
|
||||
|
||||
----
|
||||
|
||||
### insertion
|
||||
|
||||
<br>
|
||||
|
@ -21,6 +29,9 @@
|
|||
|
||||
<br>
|
||||
|
||||
|
||||
---
|
||||
|
||||
### search
|
||||
|
||||
<br>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue