Please could someone help by telling me a general algorithm for searching for entries using linear probing.
I have the following, but I think it is pseudo code instead of an algorithm: 1) use hash function to find index of where an item should be. 2) If it isn't there search records that records after that hash location until either it is found, or until an empty record is found. 3) If there is an empty spot in the table before record is found, it means that the the record is not there.
To search for a given key x, the cells of T are examined, beginning with the cell at index h(x) (where h is the hash function) and continuing to the adjacent cells h(x) + 1, h(x) + 2, ..., until finding either an empty cell or a cell whose stored key is x. If a cell containing the key is found, the search returns the value from that cell. Otherwise, if an empty cell is found, the key cannot be in the table, because it would have been placed in that cell in preference to any later cell that has not yet been searched. In this case, the search returns as its result that the key is not present in the dictionary