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

What is string in c language?

620


How can a string be converted to a number?

512


How do you define structure?

563


How is actual parameter different from the formal parameter?

587


Is c is a high level language?

618






i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

1836


What are shell structures used for?

595


What is modeling?

642


What is function prototype in c with example?

571


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures

2737


What is sizeof c?

604


Can the size of an array be declared at runtime?

602


What is the size of structure pointer in c?

610


write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3

1641


Why C language is a procedural language?

614