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


Please Help Members By Posting Answers For Below Questions

Write a program to reverse a string.

631


What is a floating point in c?

594


What is the 'named constructor idiom'?

636


What is the use of function overloading in C?

671


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

1701






Using which language Test cases are added in .ptu file of RTRT unit testing???

3579


a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none

712


Why do we use c for the speed of light?

603


Write a code to determine the total number of stops an elevator would take to serve N number of people.

725


How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?

583


What is pointer and structure in c?

563


How is = symbol different from == symbol in c programming?

607


What is the difference between the local variable and global variable in c?

524


What does d mean?

575


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

927