I have big set of urls and I want to implement an autocompletion. I don\'t like the complexity of the naive approach as it is linear with the set size:
for(S
A great alternative algo is a ternary search tree (more memory efficient) https://github.com/varunpant/TernaryTree/tree/master/TernaryTree
here is a trie in java http://algs4.cs.princeton.edu/52trie/TrieST.java.html