Quote:
Originally Posted by abdul-rehman
What are tries btw ??
Are they like CellArrays ??
|
Arrays: collection of data indexed by a number
Tries: collection of data indexed by a string
Here's some pseudo-code describing it:
Code:
array[0] = 1
array[1] = 2
trie["some string"] = 1
trie["another string"] = 2
When using tries, you obviously can't use it like I just showed you.
You use it the same way you use cellarrays, except with strings.
Code:
ArrayPushCell(array, 1)
ArrayPushCell(array, 2)
TrieSetCell(trie, "some string", 1)
TrieSetCell(trie, "another string", 2)
If you want to traverse the trie (meaning reading all keys and values), then you will either have to write small code yourself using cellarrays, or use CellTravTrie (written by Hawk552 in Code Snippets/Tutorials).
See celltrie.inc for more information on it's natives and usage.
__________________