Closed Addressing vs Open Addressing

What to prefer
- Closed Addressing for efficiency
- Open Addressing for local memory management
Dictionary Performances
Here listed below we compare some data structures we saw in this course, and we compare their times of executions for some dictionary-related operations, as dictionaries are indeed a kind of dynamic set.
Just to clarify:
is the element to which the operations PredecessorandSuccessoris applied to.is the input size of the problems is the table size for hash-tables and is their load factor is the height of the tree for the Binary Search Tree
| Data Structure | Search | Minimum | Maximum | Predecessor | Successor | Construction | Delete |
|---|---|---|---|---|---|---|---|
| Closed Address Hashtables (average case) | |||||||
| Closed Address Hashtables (worst case) | |||||||
| Open Address Hashtables (average case) | |||||||
| Open Address Hashtables (worst case) | |||||||
| Non-decreasing Sorted Array | |||||||
| Non-Increasing Sorted Array | |||||||
| Non-decreasing Sorted Double-Linked List with Sentinel | |||||||
| Non-decreasing Sorted Double-Linked List with Sentinel | |||||||
| Binary Search Tree | |||||||
| Balanced Binary Search Tree | |||||||
| Max-Heap | |||||||
| Min-Heap |
Hashtables
As we know, hash-tables do not have any efficient primitive operation to find the Successor or Predecessor. This means:
- Closed Address hash-tables must traverse the
cells and examine the keys in the lists. - Open Address hash-tables must traverse the
cells
In both case we might stop before, so we use a big O notation.
While for the Minimum and Maximum we need to check the whole content of the table, obtaining respectively the same results with
For what regards the Construction
- For Closed Address hash-tables, this represents
Insertion, which have constant time.- We insert the elements on top of the list in both cases
- For Open Address hash-tables, this represents
Search, which depend on the load factor- In the average case, it depends on the load factor (see the related theorems)
- In the worst case, for
keys we need to use the Searchwhich has linear time.
Finally the Search depends
- For Closed Address hash-tables
- In the average case, it depends on the load factor (see the related theorems)
- In the worst case, it depends on the input size as one list contains all the elements.
- For Open Address hash-tables
- In the average case, it depends on the load factor (see the related theorems)
- In the worst case, all the
inspections result in finding an occupied slot. Which means we need to iterate through the keys.