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

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

1705


p*=(++q)++*--p when p=q=1 while(q<=6)

1266


Add Two Numbers Without Using the Addition Operator

353


Explain what are the different file extensions involved when programming in c?

633


What is the use of function in c?

713






An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

609


Was 2000 a leap year?

632


What does a function declared as pascal do differently?

607


What is the use of in c?

578


string reverse using recursion

1812


How can I discover how many arguments a function was actually called with?

635


What is the use of define in c?

597


How can you increase the allowable number of simultaneously open files?

597


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

685


Describe static function with its usage?

612