🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Sorted array
  2. B.Hash set
  3. C.Linked list
  4. 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 →