Finally implemented the Introsort and also hash tables, the speed up is huge! But I have a doubt, how many buckets should I use? I inserted 1 million sorted strings in the hash table using 128 buckets in one test and 1024 buckets in the other, and got almost the same performance. Should I keep it in 128? Since it's is improbable to add more than 1 million elements.