0

If I want to implement a hash table, and two elements collide, I understand that I can either rehash via open addressing or chain at the index via a linked list.

How does the same idea apply for a set() data structure? Is the linkedlist at the collision index being traversed to see if the key already exists before insertion which implies O(N) time complexity?

driftdrift
  • 339
  • 1
  • 3
  • 11
  • A set is interface in some sense. It's not a concrete data structure. What exactly are you trying to implement? – kraskevich Mar 19 '17 at 17:31
  • Possible duplicate of [Hash table runtime complexity (insert, search and delete)](http://stackoverflow.com/questions/9214353/hash-table-runtime-complexity-insert-search-and-delete) – amit Mar 19 '17 at 17:38

0 Answers0