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