You are on page 1of 1

Advanced Algorithm Asignment 4

Qasim Shah Batch 3

The following example shows a worst case in which both linear and hashing have O(n) searching cost.

For linear search if 90 is searched

67 41 12 70 32 3 90

For Hashing if 1 is searched in the hash table.

1 was saved at position 0 as collision occurred from position 1 to 6

0 1
1 22

2 16
3 31
4 25
5 12
6 48

You might also like