Practice
Learn
← Quit
0 / 0 correct
Algorithms
Medium
1 of 173
Why is hashing used to detect duplicates in O(n) instead of sorting?
A
Sorting can't find duplicates
B
Hashing uses no memory
C
Hashing preserves order
D
Each insert/lookup in a hash set is O(1) average, versus O(n log n) for sorting