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
How can you allocate arrays or structures bigger than 64K?
How can you tell whether two strings are the same?
Can we change the value of static variable in c?
Can one function call another?
Can you think of a logic behind the game minesweeper.
What are void pointers in c?
Not all reserved words are written in lowercase. TRUE or FALSE?
What is the best organizational structure?
Which is more efficient, a switch statement or an if else chain?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if
What is bubble sort in c?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
What is floating point constants?
Where is volatile variable stored?