74.7k views
3 votes
If an item maps to an occupied bucket, then the item's index (i) is incremented by ________?

1) 1
2) 2
3) 3
4) 4

1 Answer

5 votes

Final answer:

In a hashing table, when a collision occurs, the practice of linear probing is used to resolve it by incrementing the item's index (i) by 1 until an empty bucket is found.

Step-by-step explanation:

When an item maps to an already occupied bucket in a hashing table, this situation is known as a collision. A common strategy to resolve such collisions is called linear probing. In linear probing, if an item's initial index (i) is occupied, the index is incremented by 1 to find the next available bucket. This process is repeated until an empty bucket is found. So, if an item maps to an occupied bucket, then the item's index (i) is incremented by 1.

User Major Byte
by
8.0k points