|
-
Nov 23rd, 2005, 05:52 AM
#1
Thread Starter
New Member
Binary search tree and hash table combined
I need serious help before I go on kill myself I've been starting over and over several times now.
The task given is to use two data structures, Hash table & Binary search tree for the same set of data. The hash table should be implemented as an array. The actual data value is stored in the hash table while the binary search tree stores the index in the array. We only dealing with strings and are allowed to use java method hashCode for a hash value and we need to use mod to reduce it to an appropriate index.
So for exampel, if we insert 10, 5, 15, 7 the hash values will indice 8, 9, 5, 1 and those values will be stored in the binary search tree.
The values (strings) will be read from a textfile (don't need help with this) and the first line of the textfile tells how big the array is gonna be.
The functions of the application are:
*Insert the value v where v can be any string
*print the values in sorted order
*print the values in array order
*Delete the value v (which is any string) from both the structures
Do you see the picture? I've been struggling with this for a while and can't do this on my own anymore. Anyone with a solution will be rewarded with happiness for eternity
Last edited by Oirol; Nov 23rd, 2005 at 06:01 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|