An implementation of a trie in Objective-C, NDTrie contains an immutable version NDTrie and a mutable version NDMutableTrie
Objective-C
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Classes
NDTrieTest.xcodeproj
LICENSE.txt
NDTrieTest_Prefix.pch
README
main.m
sample_file_binary.plist
sample_file_xml.plist

README

NDTrie was developed for text completion, using the method -[NDTrie everyObjectForKeyWithPrefix:] will return every string with the given prefix. For example an NDTrie with the strings {cat, catalog, category, cow, dog} for everyObjectForKeyWithPrefix:@"cat" return the strings {cat, catalog, category}.
The NDTrie project contains two classes NDTrie and a subclass NDMutableTrie, which work the same way Apples mutable and non-mutable classes work.
Though initially developed to contain strings that act as the key and value using methods like -[NSMutableTrie addString:], NDTrie can also contain any object with a string key using methods like -[NSMutableTrie setObject:forKey:].