All challenges
Multiple ChoiceIntermediate 30s

List vs Set Lookup

Choose the best answer for: lookup performance
Options
  1. 1List lookup is faster than set lookup in every case
  2. 2They have exactly the same average performance
  3. 3Set lookup is O(n) while list lookup is O(1)
  4. 4Set membership (in) is O(1) average; list is O(n)

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle