I used Trie trees to implement a class which allows for the storage of (k,v) pairs and retrieval based on prefix search or a suffix after an underscore character '_'.