← Arrays & Hashing Quiz: all 8 questions
Arrays & Hashing Quiz · Question 1 of 8
Which data structure makes "have I seen this value before?" an O(1) average check?
Which data structure makes "have I seen this value before?" an O(1) average check?
- A.Sorted array
- B.Hash set
- C.Linked list
- D.Stack
Answer & explanation
Correct answer: Hash set
A hash set jumps straight to where a value would be stored, so membership checks are O(1) on average.
Can you get the rest right without peeking?
Take the timed Arrays & Hashing Quiz quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →