I need a fully functional hash table with time complexity for search O(n). Can someone please help me?

+1 vote

I need a fully functional hash table with time complexity for search O(n). Can someone please help me?

Hash with o(n) ????, hash has complexity as o(1). Are you sure about your question?

0 votes

For search O(n) ,then you can use array of fixed size & collision can be avoided by chaining using linked

list in this case worse case when all n elements maps to the same index , linear search will take O(n)

time to find the element. In order to get the O(1) search ,Create an array of size max( all a[i]) and then map each element corresponding to their index.

...