Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Explain the difference between malloc() and calloc() function?

1063


What is a pointer value and address in c?

1143


Write a code to generate a series where the next element is the sum of last k terms.

1241


What are static variables in c?

1095


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1136


Explain 'far' and 'near' pointers in c.

1154


Why dont c comments nest?

1065


Explain the use of 'auto' keyword in c programming?

1130


Explain null pointer.

1133


Tell me when would you use a pointer to a function?

1078


How to delete a node from linked list w/o using collectons?

2796


Explain how can I remove the trailing spaces from a string?

1065


Write a program to find the biggest number of three numbers in c?

1060


C program to find all possible outcomes of a dice?

2375


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

2217