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 does %2f mean in c?

821


What is the purpose of realloc()?

776


What is build process in c?

733


What is the use of parallelize in spark?

650


Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

754






What is static and auto variables in c?

659


Why is this loop always executing once?

697


What is an array in c?

679


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

2648


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

1871


Explain how to reverse singly link list.

703


If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..

1682


Explain what does the format %10.2 mean when included in a printf statement?

934


what is stack , heap ,code segment,and data segment

2321


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

1959