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
How to write a code for reverse of string without using string functions?
formula to convert 2500mmh2o into m3/hr
Can you think of a logic behind the game minesweeper.
What are header files and what are its uses in C programming?
Which is better oop or procedural?
Can you please explain the difference between strcpy() and memcpy() function?
What are the types of macro formats?
Can we change the value of static variable in c?
What is a program?
What is the difference between variable declaration and variable definition in c?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
What is the difference between far and near in c?
Hai what is the different types of versions and their differences
What are loops in c?
What is variable in c example?