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
Explain the difference between malloc() and calloc() function?
What is a pointer value and address in c?
Write a code to generate a series where the next element is the sum of last k terms.
What are static variables in c?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
Explain 'far' and 'near' pointers in c.
Why dont c comments nest?
Explain the use of 'auto' keyword in c programming?
Explain null pointer.
Tell me when would you use a pointer to a function?
How to delete a node from linked list w/o using collectons?
Explain how can I remove the trailing spaces from a string?
Write a program to find the biggest number of three numbers in c?
C program to find all possible outcomes of a dice?
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples