P 12
P 12
memory addresses (2-digit) of locations in HT. Let the keys in K and addresses
technique to map a given key K to the address space L. Resolve the collision (if
#include <stdio.h>
#define MAX 10
char ans;
do
flag=0;
count=0;
printf("\nCollision Detected...!!!\n");
i=0;
{
if (a[i]!=-1)
i++;
} // end of while
display(a); // Display HT
return;
} // end of if
if(a[i] == -1)
a[i] = key;
flag =1;
break;
} // end of if
i=0;
if(a[i] == -1)
a[i] = key;
flag=1;
break;
} // end of if
i++;
} // end of while
} // end of else
fflush(stdin);
scanf("%c",&ans);
int i;
void main()
a[i] = -1;
while(1)
printf("\n3. Exit");
scanf("%d",&choice);
switch (choice)
{
case 1: linear_prob(a);
break;
case 2: display(a);
break;
case 3: return;
} // end of switch
} // end of while
} // end of main