コスト的にもO(1)
hashでコリジョン多いならTrieの方が速いかも
ただし、単なるTrieは遅く、Ternary Search Trieというのが速いらしい
http://pc8.2ch.net/test/read.cgi/tech/1086272325/121-