Problem
1- Array of pointers (ALL HEADS ARE INITIALIZED TO NULL)
2- Hash function : apply on data to get address
3- EVERY TIME WE READ A DATA
a. apply hah function get the address
Add to linked list ( at the end , at at the begi, insertion sort)
Partner program
1- Create an array a of pointers of size 10.
2- Initialize all pointers to zero
3- Generate 100 numbers (randomly or fill all prime numbers or fill Fibonacci)
for every number x
int ad= apply h(x) int h(int v) { return v%10}
A[ad] is the head of the linked list where to add the number x
1. Insert x at the end of list
2. Insert x at the beg
3. Using insertion sort to insert
4- SEARCH .........ask the user for a number (or generate randomly) binary search linear search
5- Print an explicit location
Your number can be found at location ad in the array A
The location in the list is not found in the list or it is at location i
Big O analysis è how long does it take to search for a value.