Solutions of Theory of Algorithms assignment 17.4-1

Solutions of Theory of Algorithms assignment 17.4-1 -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Solutions of Theory of Algorithms assignment Exercise 17.4-1 We might consider the hash table full in order to decrease the possibility of occurring of collisions. To insert a new element in the table, we need to implement two steps: computing the hash function, and inserting the key in the slot. As the time needed for both steps is
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: constant, so amortized cost is O(1). If the table is nearly full, or the input data is repeated, the insertion function will have to search through the table for an empty slot, so the actual cost will involve the cost of the insertion plus the cost of the search which will not necessarily be O(1)....
View Full Document

Ask a homework question - tutors are online