By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,286 Members | 2,422 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,286 IT Pros & Developers. It's quick & easy.

Dynamic Hashing

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.