Dynamic Hashing

T

Tinku

Hi friends

I know Static Hashing and i know about Dynamic Hashing, still i have
problem to make program with Dynamic Hashing I am new in "C" world,
please help me, my problem is:

i have to make program in Dynamic hashing i have to store int value in
nodes user only enter int value by this value i have to find hash key
and make symbol table
my struct are
-----------------------------------------------------------------------------
struct DynamicHashNode
{

int data;
struct DynamicHashNode *NextNode;
};

struct DynamicHashTable
{
char symbol[1];
struct DynamicHashTable *NextTable;
};
----------------------------------------------------------------------------------

+-----------+------------+ +-----------+------------+
| Symbol | Address | | int Data| Address |
+-----------+------------+ +-----------+------------+
^------------------ 0x605010

help me how can i get hash key and how can i make symbol by this int
value i want to make it dynamic hashing

Thanks



+-----------+------------+
| Symbol | Address |
+-----------+------------+
 
M

Mark Bluemel

Tinku said:
Hi friends

I know Static Hashing and i know about Dynamic Hashing, still i have
problem to make program with Dynamic Hashing I am new in "C" world,
please help me, my problem is:

i have to make program in Dynamic hashing i have to store int value in
nodes user only enter int value by this value i have to find hash key
and make symbol table

Do I smell homework?
my struct are
-----------------------------------------------------------------------------
struct DynamicHashNode
{

int data;
struct DynamicHashNode *NextNode;
};

struct DynamicHashTable
{
char symbol[1];
struct DynamicHashTable *NextTable;
};

If you intend "symbol" to be a variable length array (with the [1] being
a dummy length), then you're set to overwrite your NextTable pointer. If
not, why have it as an array at all?
----------------------------------------------------------------------------------

+-----------+------------+ +-----------+------------+
| Symbol | Address | | int Data| Address |
+-----------+------------+ +-----------+------------+
^------------------ 0x605010

help me how can i get hash key and how can i make symbol by this int
value i want to make it dynamic hashing

I, for one, have no idea what you are trying to do. If you gave a little
more information about your aims (what does the one character array
called "symbol" represent, what is the actual "use case" for this
structure?), it would be a lot easier to give you some guidance.

It's also helpful to see what you've tried and some information about
exactly what problems you've encountered.

However, I do wonder whether this is a discussion about programming in C
(which would be fine here) or about algorithms (which may be better done
in comp.programming, perhaps).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,264
Messages
2,571,066
Members
48,770
Latest member
ElysaD

Latest Threads

Top