DSA Programs 1 12
DSA Programs 1 12
// Function to read data from the keyboard and create the calendar
void read(struct Day *calendar, int size)
{
for (int i = 0; i < size; i++)
{
printf("Enter details for Day %d:\n", i + 1);
create( & calendar[i]);
}
}
free(calendar[i].dayName);
free(calendar[i].activity);
}
}
int main()
{
int size;
printf("Enter the number of days in the week:");
scanf("%d", & size);
// Dynamically allocate memory for the calendar
struct Day *calendar = (struct Day * ) malloc(sizeof(struct Day) * size);
// Check if memory allocation is successful
if (calendar == NULL)
{
printf("Memory allocation failed. Exiting program.\n");
return 1;
}
// Read and display the calendar
read(calendar, size);
display(calendar, size);
// Free the dynamically allocated memory
freeMemory(calendar, size);
// Free the memory allocated for the calendar array
free(calendar);
return 0;
}
----------------------------------------------OUTPUT----------------------------------------
Enter the number of days in the week: 7
Enter details for Day 1:
Enter the day name: Sunday
Enter the date: 1
Enter the activity for the day: Learning
Day 2:
Day Name: Monday
Date: 2
Activity: Coding
Day 3:
Day Name: Tuesday
Date: 3
Activity: Testing
Day 4:
Day Name: Wednesday
Date: 4
Activity: Debugging
Day 5:
Day Name: Thrusday
Date: 5
Activity: Publishing
Day 6:
Day Name: Friday
Date: 6
Activity: Marketing
Day 7:
Day Name: Saturday
Date: 7
Activity: Earning
/***************************************************************************
*File : 03_Stack.c
*Description: Stack Operations
*Author : Dept of CSE,YIT
*Compiler : gcc compiler
*Date : 15 December 2023
***************************************************************************/
#include <stdio.h>
#include <conio.h>
#include <math.h>
#define max 5
int s[max],stop;
int ele,stk[max],sp,ch;
return(s[(*top)--]);
}
while(sp!=-1)
rev=rev+(pop(st,&sp)*pow(10,i++));
if(ele==rev)
printf("palendrome\n");
else
printf("not a palindrome\n");
}
void main()
{
stop= -1,sp= -1;
while(1)
{
printf("Enter the choice:\n");
printf("--------------------------------------------------\n");
printf("Enter 1 to insert an element into the STACK\n");
printf("Enter 2 to delete an element from the STACK\n");
printf("Enter 3 to check an element is palindrome or not\n");
printf("Enter 4 to check the status of the STACK\n");
printf("Enter 5 to exit\n");
printf("--------------------------------------------------\n");
scanf("%d",&ch);
switch(ch)
{
case 1:printf("Enter the element to de inserted to STACK\n");
scanf("%d",&ele);
push(ele,s,&stop);
break;
case 2:ele=pop(s,&stop);
if(ele!=0)
printf("element poped is %d\n",ele);
break;
case 3:printf("Enter the elements to chech weather it is a
palindrome\n");
scanf("%d",&ele);
palindrome(ele,stk);
break;
case 4:printf("the status of the STACK \n");
display(s,&stop);
break;
case 5:exit(0);
}
}
}
----------------------------------------------OUTPUT----------------------------------------
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
Enter 3 to check an element is palindrome or not
Enter 4 to check the status of the STACK
Enter 5 to exit
--------------------------------------------------
1
Enter the element to de inserted to STACK
10
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
Enter 3 to check an element is palindrome or not
Dept. of CSE, YIT ,Moodbidri Page 8
BCSL305-Data Structure Laboratory
50
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
Enter 3 to check an element is palindrome or not
Enter 4 to check the status of the STACK
Enter 5 to exit
--------------------------------------------------
1
Enter the element to de inserted to STACK
60
stock overflow
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
Enter 3 to check an element is palindrome or not
Enter 4 to check the status of the STACK
Enter 5 to exit
--------------------------------------------------
3
Enter the elements to chech weather it is a palindrome
121
palendrome
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
Enter 3 to check an element is palindrome or not
Enter 4 to check the status of the STACK
Enter 5 to exit
--------------------------------------------------
3
Enter the elements to chech weather it is a palindrome
12345
not a palindrome
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
Enter 3 to check an element is palindrome or not
Enter 4 to check the status of the STACK
Enter 5 to exit
--------------------------------------------------
2
element poped is 50
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
Enter 3 to check an element is palindrome or not
Enter 4 to check the status of the STACK
Enter 5 to exit
--------------------------------------------------
2
element poped is 40
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
Enter 3 to check an element is palindrome or not
Enter 4 to check the status of the STACK
Enter 5 to exit
--------------------------------------------------
4
the status of the STACK
30
20
10
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
Enter 3 to check an element is palindrome or not
Enter 4 to check the status of the STACK
Enter 5 to exit
--------------------------------------------------
2
element poped is 30
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
Enter 3 to check an element is palindrome or not
Enter 4 to check the status of the STACK
Enter 5 to exit
--------------------------------------------------
2
element poped is 20
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
Enter 3 to check an element is palindrome or not
Enter 4 to check the status of the STACK
Enter 5 to exit
--------------------------------------------------
2
element poped is 10
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
Enter 3 to check an element is palindrome or not
Enter 4 to check the status of the STACK
Enter 5 to exit
--------------------------------------------------
2
stack empty | underflow
Enter the choice:
--------------------------------------------------
Enter 1 to insert an element into the STACK
Enter 2 to delete an element from the STACK
void read()
{
printf("\n Enter MAIN string:\n");
gets(STR);
printf("\n Enter PATTERN string:\n");
gets(PAT);
printf("\n Enter REPLACE string\n");
gets(REP);
}
void replace()
{
i=m=c=j=0;
while(STR[c]!='\0')
{
if(STR[m]==PAT[i])
{
i++;m++;
if(PAT[i]=='\0')
{
for(k=0;REP[k]!='\0';k++,j++)
ANS[j]=REP[k];
i=0;c=m;flag=1;
}
}
else
{
ANS[j]=STR[c];
j++;c++;m=c;i=0;
}
} // while
if(flag==0)
printf("pattern doesen't found!!!\n");
else
{
ANS[j]='\0';
printf("\n The RESULTANT string is %s \n",ANS);
}
}// replace
void main()
{
read();
replace();
}
----------------------------------------------OUTPUT----------------------------------------
Enter MAIN string:
Engg is so fun
----------------------------------------------OUTPUT----------------------------------------
Enter MAIN string:
Ram is a god
case '*':
case '%':
case '/':return 3;
case '^':
case '$':return 6;
case '(':return 9;
case ')':return 0;
default :return 7;
}
}
void main()
{
char infix[20];
char postfix[20];
{
if(n)
{
tower(n-1,src,des,intr);
printf("disk %d moved from %c to %c\n",n,src,des);
count++;
tower(n-1,intr,src,des);
}
}
void main()
{
int n, choice,i,op1,op2,ans,stack[50];
char expr[20],symb;
while(1)
{
printf("\nProgram to perform evaluation of suffix expression and tower of
hanoi problem\n");
printf("\n1.Evaluate suffix expression\n2.Tower of hanoi\n3.Exit\n ");
printf("\nEnter the choice\n");
scanf("%d",&choice);
switch(choice)
{
case 1: printf("Enter the suffix expression : ");
scanf("%s",expr);
for(i=0;expr[i]!= '\0';i++)
{
symb=expr[i];
if(symb>='0' && symb<='9')
push(stack, symb-'0');
else
{
op2=pop(stack);
op1=pop(stack);
printf("given expr is %d %d %c\n",op2,op1,symb);
ans=operate(symb,op1,op2);
push(stack,ans);
}
}
ans=pop(stack);
printf("The result of the suffix expression is %d",ans);
break;
case 2: printf("Enter the number of disks\n");
scanf("%d",&n);
tower(n,'a','b','c');
printf("Number of moves taken to move disks from source to
destination %d",count);
break;
case 3: return;
}
}
}
----------------------------------------------OUTPUT----------------------------------------
Program to perform evaluation of suffix expression and tower of hanoi problem
case 1:insert();
break;
case 2:delete();
break;
case 3:display();
break;
case 4:return;
}
}
}
void insert()
{
if(count==MAX)
{
printf("CIRCULAR QUEUE is full,elements can not be inserted\n");
return;
}
rear=(rear+1)%MAX;
printf("\n Enter the element to be inserted into the CIRCULAR QUEUE\n");
scanf("%d",&element);
cqueue[rear]=element;
count++;
}
void delete()
{
if(count==0)
{ printf("CIRCULAR QHEUE is empty,no element to delete\n");
return;
}
item_deleted=cqueue[front];
printf("the element deleted is %d\n",item_deleted);
front=(front+1)%MAX;
count-=1;
}
void display()
{
int i,f;
if(count==0)
{
printf("CIRCULAR QUEUE is empty , no element to display\n");
return;
}
printf("CIRCULAR QUEUE contants are\n");
for(i=0,f=front;i<count;i++)
{
printf("%d\t",cqueue[f]);
f=(f+1)%MAX;
}
}
----------------------------------------------OUTPUT----------------------------------------
Program to illustrate operations on CIRCULAR QUEUE of characters
struct node
{
char usn[11];
char name[20];
char branch[20];
int semester;
char phone[20];
struct node *link;
};
typedef struct node*NODE;
NODE getnode()
{
Dept. of CSE, YIT ,Moodbidri Page 30
BCSL305-Data Structure Laboratory
NODE x;
x=(NODE)malloc(sizeof(struct node));
if(x==NULL)
{
printf("out of memory\n");
exit(0);
}
return x;
}
cur=first;
while(cur->link!=NULL)
{
cur=cur->link;
}
cur->link=temp;
return first;
}
prev=NULL;
cur=first;
while(cur->link!=NULL)
{
prev=cur;
cur=cur->link;
}
printf("delete student record:USN=%s\n",cur->usn);
free(cur);
prev->link=NULL;
return first;
}
void main()
{
NODE first;
int choice;
STUDENT item;
first=NULL;
for(;;)
{
printf("1.insert_front\n2.insert_rear\n3.delete_front\n4.delete_rear\n5.display
\n6.exit\n");
printf("Enter the choice:");
scanf("%d",&choice);
switch(choice)
{
case 1:
printf("USN :");
scanf("%s",item.usn);
printf("name :");
scanf("%s",item.name);
printf("branch :");
scanf("%s",item.branch);
printf("semester:");
scanf("%d",&item.semester);
printf("phone :");
scanf("%s",item.phone);
first=insert_front(item,first);
break;
case 2:
printf("USN :");
scanf("%s",item.usn);
printf("name :");
scanf("%s",item.name);
printf("branch :");
scanf("%s",item.branch);
printf("semester:");
scanf("%d",&item.semester);
printf("phone :");
scanf("%s",item.phone);
first=insert_rear(item,first);
break;
case 3:
first=delete_front(first);
break;
case 4:
first=delete_rear(first);
break;
case 5:
display(first);
break;
default:
exit(0);
}
}
}
----------------------------------------------OUTPUT----------------------------------------
1.insert_front
2.insert_rear
3.delete_front
4.delete_rear
5.display
6.exit
Enter the choice:1
USN :4DM22CS001
name :Abhi
branch :CSE
semester:3
phone :9900123456
1.insert_front
2.insert_rear
3.delete_front
4.delete_rear
5.display
6.exit
Enter the choice:2
USN :4DM22ME002
name :Sriram
branch :ME
semester:5
phone :9912909012
1.insert_front
2.insert_rear
3.delete_front
4.delete_rear
5.display
6.exit
Enter the choice:5
4DM22CS001 Abhi CSE 3 9900123456
4DM22ME002 Sriram ME 5 9912909012
number of students=2
1.insert_front
2.insert_rear
3.delete_front
4.delete_rear
5.display
6.exit
Enter the choice:1
USN :4DM22EE001
name :Praveen
branch :EEE
semester:2
phone :9880789789
1.insert_front
2.insert_rear
3.delete_front
4.delete_rear
5.display
6.exit
Enter the choice:5
4DM22EE001 Praveen EEE 2 9880789789
4DM22CS001 Abhi CSE 3 9900123456
4DM22ME002 Sriram ME 5 9912909012
number of students=3
1.insert_front
2.insert_rear
3.delete_front
4.delete_rear
5.display
6.exit
Enter the choice:3
delete student record:USN=4DM22EE001
1.insert_front
2.insert_rear
3.delete_front
4.delete_rear
5.display
6.exit
Enter the choice:4
delete student record:USN=4DM22ME002
1.insert_front
2.insert_rear
3.delete_front
4.delete_rear
5.display
6.exit
Enter the choice:5
4DM22CS001 Abhi CSE 3 9900123456
number of students=1
1.insert_front
2.insert_rear
3.delete_front
4.delete_rear
5.display
6.exit
Enter the choice:
typedef struct
{
int ssn;
char name[20];
char department[20];
char designation[20];
float salary;
char phone[20];
} EMPLOYEE;
struct node
{
int ssn;
char name[20];
char department[20];
char designation[20];
float salary;
char phone[20];
NODE getnode()
{
NODE x;
x = ( NODE ) malloc(sizeof(struct node)); /* allocate the memory space */
if ( x == NULL ) /* Free nodes don’t exist */
{
printf("Out of memory\n"); /* Allocation failed */
exit(0); /* Terminate the program */
}
return x; /* allocation successful */
}
// Main function
void main()
{
NODE first;
int choice;
EMPLOYEE item;
first = NULL;
for (;;)
{
printf("1:Insert_Front 2: Insert_Rear\n");
printf("3:Delete_Front 4: Delete_Rear\n");
printf("5:Display 6: Exit\n");
default: exit(0);
}
}
}
----------------------------------------------OUTPUT----------------------------------------
1:Insert_Front 2: Insert_Rear
3:Delete_Front 4: Delete_Rear
5:Display 6: Exit
Enter the choice
1
ssn :3434
name :Ravi
department :cse
designation :asstprof
salary :34000
phone :9900123456
1:Insert_Front 2: Insert_Rear
3:Delete_Front 4: Delete_Rear
5:Display 6: Exit
Enter the choice
2
ssn :1212
name :Ramu
department :ise
designation :prof
salary :12000
phone :8972345678
1:Insert_Front 2: Insert_Rear
3:Delete_Front 4: Delete_Rear
5:Display 6: Exit
Enter the choice
5
3434 34000.00 Ravi cse asstprof 9900123456
1212 12000.00 Ramu ise prof 8972345678
Number of employees = 2
1:Insert_Front 2: Insert_Rear
3:Delete_Front 4: Delete_Rear
5:Display 6: Exit
Enter the choice
4
Employee details deleted: ssn=1212
1:Insert_Front 2: Insert_Rear
3:Delete_Front 4: Delete_Rear
5:Display 6: Exit
Enter the choice
2
ssn :1234
name :Reetha
department :AIML
designation :Asstprof
salary :45000
phone :9272347899
1:Insert_Front 2: Insert_Rear
3:Delete_Front 4: Delete_Rear
5:Display 6: Exit
Enter the choice
5
3434 34000.00 Ravi cse asstprof 9900123456
1234 45000.00 Reetha AIML Asstprof 9272347899
Number of employees = 2
1:Insert_Front 2: Insert_Rear
3:Delete_Front 4: Delete_Rear
5:Display 6: Exit
Enter the choice
3
Employee details deleted: ssn=3434
1:Insert_Front 2: Insert_Rear
3:Delete_Front 4: Delete_Rear
5:Display 6: Exit
Enter the choice: 6
struct node
{
int cf;
int px, py, pz;
struct node *link;
};
typedef struct node* NODE;
// Read a polynomial
NODE read_poly(NODE head)
{
int i, n;
int cf, px, py, pz; /* To hold term of a polynomial */
printf("Enter the number of terms in the polynomial:");
scanf("%d", &n);
for(i = 1; i <= n; i++)
{
printf("Enter term: %d\n", i); printf("Cf px py pz = ");
scanf("%d %d %d %d", &cf, &px, &py, &pz); /* Enter each term */
head = insert_rear (cf, px, py, pz, head); /* insert at the end */
}
return head;
}
return sum;
}
void main()
{
NODE head,h1,h2,h3;
float res;
int choice;
for (;;)
{
printf("1:To Evvaluate the Polynomial 2: To add two Polynomials\n");
printf("3:Exit\n");
printf("Enter the choice\n");
scanf("%d", &choice);
switch(choice)
{
----------------------------------------------OUTPUT----------------------------------------
1:To Evaluate the Polynomial 2: To add two Polynomials
3:Exit
Enter the choice
1
Enter the polynomial
Enter the number of terms in the polynomial:3
Enter term: 1
Cf px py pz = 2 3 4 5
Enter term: 2
Cf px py pz = 3 4 5 6
Enter term: 3
Cf px py pz = 2 3 4 5
Enter the value of x, y and z
123
The given polynomial is
+2x^3y^4z^5+3x^4y^5z^6+2x^3y^4z^5
The result = 85536.000000
1:To Evaluate the Polynomial 2: To add two Polynomials
3:Exit
Enter the choice
2
Enter the first polynomial
Enter the number of terms in the polynomial:2
Enter term: 1
Cf px py pz = 2 3 0 4
Enter term: 2
Cf px py pz = 3 0 1 2
Enter the second polynomial
Enter the number of terms in the polynomial:3
Enter term: 1
Cf px py pz = 1 2 3 4
Enter term: 2
Cf px py pz = 2 0 0 0
Enter term: 3
Cf px py pz = 3 3 0 2
Poly 1:+2x^3z^4+3y^1z^2
Poly 2:+1x^2y^3z^4+2+3x^3z^2
-------------------------------------------------------------------------------
struct node
{
int data;
struct node *lchild, *rchild;
};
typedef struct node* NODE;
NODE tree = NULL;
{
p=q;
if(a[i] < p->data)
q = p->lchild;
else if(a[i] > p->data)
q = p->rchild;
else
{
free(temp);
break;
}
}
if( q == NULL)
{
if(a[i] < p->data)
p->lchild = temp;
else
p->rchild = temp;
}
}
}
printf("Binary Seacrh Tree created\n\n");
}
printf("%d ",tree->data);
Preorder(tree->lchild);
Preorder(tree->rchild);
}
}
int main()
{
int a[MAX], n, i, choice;
while(1)
{
printf("\n\n**********************MENU*****************");
printf("\n1. Create a BST of n integers\n2. Traverse the BST in Inorder\n3.
Traverse the BST in Preorder\n4. Traverse the BST in Postorder\n5. Exit\n");
printf("Enter your choice : ");
scanf("%d",&choice);
switch(choice)
{
case 1 : printf("Enter the number of integers : ");
scanf("%d",&n);
printf("Enter the elements\n");
for(i=0; i<n; i++)
scanf("%d",&a[i]);
CreateBST(a, n);
break;
case 2 : printf("Inorder Traversal :\n");
Inorder(tree);
break;
----------------------------------------------OUTPUT----------------------------------------
**********************MENU*****************
1. Create a BST of n integers
2. Traverse the BST in Inorder
3. Traverse the BST in Preorder
4. Traverse the BST in Postorder
5. Exit
Enter your choice : 1
Enter the number of integers : 3
Enter the elements
10 20 5
Binary Seacrh Tree created
**********************MENU*****************
1. Create a BST of n integers
2. Traverse the BST in Inorder
3. Traverse the BST in Preorder
4. Traverse the BST in Postorder
5. Exit
Enter your choice : 2
Inorder Traversal :
5 10 20
**********************MENU*****************
1. Create a BST of n integers
2. Traverse the BST in Inorder
3. Traverse the BST in Preorder
4. Traverse the BST in Postorder
5. Exit
Enter your choice : 3
Preorder Traversal :
10 5 20
**********************MENU*****************
1. Create a BST of n integers
2. Traverse the BST in Inorder
3. Traverse the BST in Preorder
4. Traverse the BST in Postorder
5. Exit
Enter your choice : 4
Postoder Traversal :
5 20 10
**********************MENU*****************
1. Create a BST of n integers
2. Traverse the BST in Inorder
3. Traverse the BST in Preorder
4. Traverse the BST in Postorder
5. Exit
Enter your choice : 4
Postoder Traversal :
5 20 10
**********************MENU*****************
1. Create a BST of n integers
2. Traverse the BST in Inorder
3. Traverse the BST in Preorder
4. Traverse the BST in Postorder
5. Exit
Enter your choice : 5
int source;
{
printf("%d ", v);
visited[v] = 1;
queue[++r] = v;
}
}
}
}
int main()
{
int a[MAX][MAX], visited[MAX], n, choice, i, j, x, y;
printf("Enter the number of vertices in the graph : ");
scanf("%d", &n);
printf("Enter the adjacency matrix for the graph\n");
for(i=1; i<=n; i++)
for(j=1; j<=n; j++)
scanf("%d",&a[i][j]);
printf("Enter the starting node of the graph : ");
scanf("%d",&source);
while(1)
{
printf("\n\n**********************MENU*****************");
printf("\n1. DFS\n2. BFS\n3. Exit\n");
printf("Enter your choice : ");
scanf("%d", &choice);
switch(choice)
{
case 1 : printf("Nodes reachable from %d using DFS method\n", source);
for(x=1; x<=n; x++)
visited[x] = 0;
DFS(a, visited, source, n);
break;
case 2 : printf("Nodes reachable from %d using BFS method\n", source);
for(y=1; y<=n; y++)
visited[y] = 0;
BFS(a, visited, source, n);
break;
case 3: exit(0);
break;
}
}
}
**************************************OUTPUT***************************************
Consider the following graph
1
1
1
2 1 3
1 2 1
1 a 1
1 a 2
4 5 6 7
2 a
1 5 1 1
a a
1 1 1 1
a
Enter the number
1 of vertices
1 in the graph
1 :7 1
Enter the adjacency
2 matrix
1 for the graph
2 2
0 1 1 0 0 0a 0 2 a a
0 0 0 1 1 0a 0 a a a
0000011 a
0000000
0000000
0000000
0000000
Enter the starting node of the graph: 1
**********************MENU*****************
1. DFS
2. BFS
3. Exit
Enter your choice : 1
Nodes reachable from 1 using DFS method
2 4 5 3 6 7
**********************MENU*****************
1. DFS
2. BFS
3. Exit
Enter your choice: 2
Nodes reachable from 1 using BFS method
2 3 4 5 6 7
**********************MENU*****************
1. DFS
2. BFS
3. Exit
Enter your choice : 3
Program 12: Design and develop a program in C that uses Hash Function
H:K->L as H(K)=K mod m(reminder method) and implement hashing
technique to map a given key K to the address space L. Resolve the
collision (if any) using linear probing.
/***************************************************************************
*File : 12_HashingTechnique.c
*Description: Implement Hashing Technique
*Author : Dept of CSE,YIT
*Compiler : gcc compiler
*Date : 10 February 2024
***************************************************************************/
#include<stdio.h>
#include<stdlib.h>
#define MAX 100
int main()
{
int n,m,ht[MAX],i, j, k, rec, address, homebucket, currentbucket, count =
0, choice;
printf("Enter the number of employee records : ");
scanf("%d", &n);
for(i = 0; i < MAX; i++)
ht[i] = -1;
for(k = 0; k <n; k++)
{
printf("\nEnter the record %d\n", k+1);
scanf("%d", &rec);
address = rec % MAX;
homebucket = address;
currentbucket = homebucket;
while(ht[currentbucket] != -1)
{
currentbucket = (currentbucket + 1) % MAX;
if(currentbucket == homebucket)
{
printf("Hash Table Overflow");
exit(0);
}
count++;
}
if(count != 0)
*******************************OUTPUT************************************
**********************MENU*****************
1. Complete Hash table contents
2. Hash Table showing only record entries
3. Exit
9 -1
10 -1
11 -1
12 -1
13 -1
14 -1
15 -1
16 -1
17 -1
18 -1
19 -1
20 -1
21 -1
22 -1
23 -1
24 -1
25 -1
26 -1
27 -1
28 -1
29 -1
30 -1
31 1231
32 2231
33 -1
34 -1
35 -1
36 -1
37 -1
38 -1
39 -1
40 -1
41 -1
42 -1
43 -1
44 -1
45 -1
46 -1
47 -1
48 -1
49 -1
50 -1
51 -1
52 -1
53 -1
54 -1
55 -1
56 -1
57 -1
58 -1
59 -1
60 -1
61 -1
62 -1
63 -1
64 -1
65 1265
66 -1
67 -1
68 -1
69 -1
70 -1
71 -1
72 -1
73 -1
74 -1
75 -1
76 -1
77 -1
78 -1
79 -1
80 -1
81 -1
82 -1
83 -1
84 -1
85 -1
86 -1
87 -1
88 -1
89 -1
90 -1
91 -1
92 -1
93 -1
94 -1
95 -1
96 -1
97 -1
98 -1
99 1299
**********************MENU*****************
1. Complete Hash table contents
2. Hash Table showing only record entries
3. Exit
**********************MENU*****************
1. Complete Hash table contents
2. Hash Table showing only record entries
3. Exit
Enter your choice : 3