diff --git a/Ideas.md.gpg b/Ideas.md.gpg index e9bab66..ff79d6b 100644 Binary files a/Ideas.md.gpg and b/Ideas.md.gpg differ diff --git a/tech/algorithms.wiki b/tech/algorithms.wiki index d3834be..5d6a673 100644 --- a/tech/algorithms.wiki +++ b/tech/algorithms.wiki @@ -15,6 +15,7 @@ Different ways to store and operate on data, with differing efficiency == Non sequential Data Structures == * [[binary_tree|Binary Tree]] +* [[trie|Trie]] * [[graph|Graph]] * [[b_tree|B-Tree]] * [[red_black_tree|Red Black Tree]] diff --git a/tech/trie.wiki b/tech/trie.wiki new file mode 100644 index 0000000..8f34984 --- /dev/null +++ b/tech/trie.wiki @@ -0,0 +1,18 @@ += Trie = + +A trie (pronounced "tree"), aka digital tree or prefix tree, is a type of +search tree used for locating keys within a set. The keys are usually strings, +however any datatype can be used. To find a key, the tree is traveresed +using [[DFS]]. + +Nodes in a trie can have any number of children, and only leaves actually store +their values. Each child node stores another more specific permutation of the +current node's key, unless it is a leaf. + +== Operations == + +M is the length of a key + +| Insertion | O(M) | +| Deletion | O(M) | +| Search | O(M) |