Data Structures and Algorithms
with Object-Oriented Design Patterns in C# |
The definition of the Find method of the ChainedHashTable class is given in Program . The Find method takes as its argument any ComparableObject. The purpose of the Find operation is to return the object in the container that is equal to the given object.
Program: ChainedHashTable class Find method.
The Find method simply hashes its argument to select the linked list in which it should be found. Then, it traverses the linked list to locate the target object. As for the Withdraw operation, the worst case running time of the Find method occurs when all the objects in the container have collided, and the item that is being sought does not appear in the linked list. In this case, the running time of the find operation is .