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
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?
What is static and auto variables in c?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
How can I find out the size of a file, prior to reading it in?
Explain how to reverse singly link list.
How does struct work in c?
Implement bit Array in C.
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
What are the types of macro formats?
can anyone please tell about the nested interrupts?
What are the advantages of using new operator as compared to the function malloc ()?
Where in memory are my variables stored?
What is wrong with this statement? Myname = 'robin';
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
Can we use any name in place of argv and argc as command line arguments?