Weitere Beispiele werden automatisch zu den Stichwörtern zugeordnet - wir garantieren ihre Korrektheit nicht.
The above picture is a balanced ternary search tree for the same set of 12 words.
The running time of ternary search trees varies significantly with the input.
There is some evidence that shows ternary search trees running faster than hash maps.
Common applications for ternary search trees include spell-checking and auto-completion.
Hashtables can also be used in place of ternary search trees for mapping strings to values.
However, ternary search trees are more space efficient compared to standard prefix trees, at the cost of speed.
Alternatively, ternary search trees are effective when storing a large number of relatively short strings (such as words in a dictionary).
However, hash maps also frequently use more memory than ternary search trees (but not as much as tries).
Ternary search trees run best when given several similar strings, especially when those strings share a common prefix.
Time complexities for ternary search tree operations:
As with other trie data structures, each node in a ternary search tree represents a prefix of the stored strings.
Like other prefix trees, a ternary search tree can be used as an associative map structure with the ability for incremental string search.
Like binary search trees and other data structures, ternary search trees can become degenerate depending on the order of the keys.
While being slower than other prefix trees, ternary search trees can be better suited for larger data sets due to their space-efficiency.
Additionally, hash maps do not allow for many of the uses of ternary search trees such as near-neighbor lookups.
Ternary search trees can be used to solve many problems in which a large number of strings must be stored and retrieved in an arbitrary order.
In computer science, a ternary search tree is a type of prefix tree where nodes are arranged as a binary search tree.
Ternary trees are used to implement Ternary search trees and Ternary heaps.
Running times for ternary search trees are similar to binary search trees in that they typically run in logarithmic time but can run in linear time in the degenerate case.
Each node of a ternary search tree stores a single character, an object (or a pointer to an object depending on implementation), and pointers to its three children conventionally named "equal kid" "lo kid" and "hi kid."