1.find the second maximum in an array?
2.how do you create hash table in c?
3.what is hash collision
Answer Posted / shanthi
2.
hash table is a table with one row with 10 columns say.
now to create hash table
struct phonerec
{
char name;
int phoneno;
};
struct node
{
struct phonerec r;
struct node *pnext;
};
struct node *hash[10];
int hashfun(int phoneno)
{
return phone%10;
}
int add(struct phonerec *pr);
{
struct node *pn;
pn = malloc(sizeof(*pn));
pn->r=*pr;
int hix=hashfun(pr->phoneno);
pn->pnext=hasharray[hix];
hasharray[hix]=pn;
return SUCCESS;
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is volatile, register definition in C
What are conditional operators in C?
please give me some tips for the placement in the TCS.
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
using only #include
What are the 4 data types?
What are the different types of control structures?
What are structure members?
What is unary operator?
Where we use clrscr in c?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
What are near, far and huge pointers?
What does sizeof function do?
What is the size of enum in bytes?
What are the parts of c program?