Can someone plz give me the C++ code for the following:

(1) linear probing
(2) separate chaining
(3) quadratic probing
(4) double hashing

I know the theory behind it but i dont seem to be able to put it into code!
plz help me

P/S: im not asking you to spoon feed me with code but im really not able to figure out how to write these functions....

Recommended Answers

All 2 Replies

Have a go at the design of an algorithm first - after you know what you want the code to do, the actual code will come easier.

>I know the theory behind it but i dont seem to be able to put it into code!
Then you don't really know the theory behind it. ;) Not to be rude or anything, but these are all pretty straightforward concepts and the code ends up being very short compared to other data structures. This might help you get a feel for how things work in practice.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.