A

Admin • 828.03K Points
Coach

Q. What is the time complexity of contains() in HashSet in average case?

  • (A) O(1)
  • (B) O(n)
  • (C) O(log n)
  • (D) O(n log n)
  • Correct Answer - Option(A)
  • Views: 7
  • Filed under category Java
  • Hashtags: Java Set

Explanation by: Admin
HashSet provides O(1) average-case time complexity for contains().

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.