DEV Community

Discussion on: Daily Challenge #3 - Vowel Counter

Collapse
protium profile image
Brian Mayo

Not sure if I follow. O(n log n) is worst than O(n). Insertions in a binary tree are expensive to keep it balanced.
If you use a set or hashmap assuming zero collisions, the look up is O(1). Then the bottke neck is in the string iteration. Right?