News for hackers. Stuff that matters.
Re:Compressing Scrabble Dictionaries by binarymax on Wednesday June 04, 2014 @08:27AM (#7845150)
Yes good point, allow me to clarify. n is the number of keys in the dictionary (log n for the binary search). I suppose yes it is probably the more complex O(n log n) to sort the letters before the search.
Re:Compressing Scrabble Dictionaries by bradleyjg on Wednesday June 04, 2014 @11:53AM (#7846292)
If n is the number of keys in the dictionary, then the whole procedure would not be O(n log n), it'd be O(m log n) where m is the number of letters. Given that n >> m, I would think your original statement is correct.
Re:Compressing Scrabble Dictionaries by dbaupp on Wednesday June 04, 2014 @07:22PM (#7849123)
Oh, so I guess it is strictly O(m log m + log n) if m is the number of letters. You can theoretically get it to be O(m log m) using a hashmap (makes lookups O(1)) or trie (lookups are O(m)).