468,727 Members | 1,665 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,727 developers. It's quick & easy.

Dynamic Hashing

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 |
+-----------+------------+

Nov 13 '07 #1
1 3903
Tinku wrote:
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).
Nov 13 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Pat | last post: by
1 post views Thread by snowteo | last post: by
11 posts views Thread by Wm. Scott Miller | last post: by
10 posts views Thread by Dino M. Buljubasic | last post: by
19 posts views Thread by Ole Nielsby | last post: by
8 posts views Thread by Maya | last post: by
6 posts views Thread by Jayender | last post: by
reply views Thread by s.phonologies | last post: by
15 posts views Thread by Vinodh | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.