list_ = [113 , 117 , 97 , 100 , 114 , 108 , 116 , 105 , 99] hash_values =  def hash_func(list_): list_2 = [None for i in range(11)] for i in list_: #print(i % len(list_2)) hash_values.append(i % len(list_2)) list_2[i % len(list_2)] = i print(list_2) print(list_) print(hash_values) print(116 % 11) print(97 % 11) print(hash_func(list_)) #print(set(hash_values))
Do you have a question?
Yes,I actually forgot to write the question completely
I was trying to work on Hashing technique,I have performed hashing but there are collisions in the hashed list,so I want to use Linear probing or Open addressing techniques to reduce the collisions in the list.Can you tell me how to use it.
Well, I am not too familiar with hashing, but perhaps this lesson/challenge could be of use: https://www.freecodecamp.org/learn/coding-interview-prep/data-structures/create-a-hash-table
Hope this helps