Full stack web dev.
Studying FP web development approaches, while helping Mission Bit create paths to programming for underserved public school kids.
Previously @ Gradescope.
You also have to traverse the tree to get to the next letter. But I see what you mean. Only counting equality checks, hard-coding behaves like a linear search. My bad.
I think you might still be missing Brian's point that a hash set has O(1) lookup time, which is faster than the tree set's O(log n).
(On paper. Real-world implementations vary. e.g. Ruby's hashes just do linear search at this size.)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You also have to traverse the tree to get to the next letter. But I see what you mean. Only counting equality checks, hard-coding behaves like a linear search. My bad.
I think you might still be missing Brian's point that a hash set has O(1) lookup time, which is faster than the tree set's O(log n).
(On paper. Real-world implementations vary. e.g. Ruby's hashes just do linear search at this size.)