quiz

Full-stack dev quiz question #65

Full-stack dev quiz question #65quiz

HashSet is probably the most popular implementation of a set in Java. An important reason of that is computational complexity of crucial operation on HashSet. Check sixty fith question of full-stack dev quiz to find out, if you know what that means.

What computational complexity the contains method has of HashSet?

Choose all valid answers.

  1. O(1)
  2. O(n)
  3. O(n logn)
  4. constant
  5. linear
  6. logarithmic

For the correct answer scroll down

.

.

 

 

 

 

 

 

 

 

 

 

Do not miss valuable content. You will receive a monthly summary email. You can unsubscribe anytime.

 

 

 

 

 

 

 

 

 

 

 

 

 

.

.

.

The correct answer is: a,d. If you would like to read more, check Is it worth using HashSet for a few elements? article.

If you like what I do, consider buying me a coffee :)

Buy me a coffeeBuy me a coffee