hashtable

Hash Tables - Java

Am about to do a homework, and i need to store quite a lot of information (Dictionary) in a data structure of my choice. I heard people in my classroom saying hash-tables are the way to go. How come? ...

Hashtable implementation tutorial

Does anyone know a good website for learning how to create and implement hash tables for beginners in java? ...

Hashtable implementation for C

what is a good hashtable implementation for C? I need to use it with mpicc compiler. Delete function is not necessary. ...

Copy hashtable to another hashtable using c++

I am starting with c++ and need to know, what should be the approach to copy one hashtable to another hashtable in C++? We can easily do this in java using: HashMap copyOfOriginal=new HashMap(original); But what about C++? How should I go about it? UPDATE Well, I am doing it at a very basic level,perhaps the java example was a wrong ...

Why is the table attribute of Hashtable serialized?

Why is the table field of Hashtable serialized, although it is marked as transient? ...

Chained Hash Tables vs. Open-Addressed Hash Tables

Can somebody explain the main differences between (advantages / disadvantages) the two implementations? For a library, what implementation is recommended? ...

how to Compute the average probe length for success and failure - Linear probe (Hash Tables)

hi everyone, I'm doing an assignment for my Data Structures class. we were asked to to study linear probing with load factors of .1, .2 , .3, ...., and .9. The formula for testing is: The average probe length using linear probing is roughly Success--> ( 1 + 1/(1-L)**2)/2 or Failure--> (1+1(1-L))/2. we are required to find the theo...

Why might stable_sort be affecting my hashtable values?

I have defined a struct ABC to contain an int ID, string NAME, string LAST_NAME; My procedure is this: Read in a line from an input file. Parse each line into first name and last name and insert into the ABC struct. Also, the struct's ID is given by the number of the input line. Then, push_back the struct into a vector masterlist. I a...

Problem while adding a new value to a hashtable when it is enumerated

`hi I am doing a simple synchronous socket programming,in which i employed twothreads one for accepting the client and put the socket object into a collection,other thread will loop through the collection and send message to each client through the socket object. the problem is 1.i connect to clients to the server and start send messa...

Need help in Hashtable implementation

Hi all, i'm quite a beginner in C# , i tried to write a program that extract words from an entered string, the user has to enter a minimum length for the word to filter the words output ... my code doesn't look good or intuitive, i used two arrays countStr to store words , countArr to store word length corresponding to each word .. but t...

.Net Hashtable - Contains vs ContainsKey

I just noticed the HashTable objects have a Contains and CotainsKey method, with same description. So are they just synonyms or is there som edifference behind the scenes ...

What is a hash map in programming and where can it be used

I have often heard people talking about hashing and hash maps and hash tables. I wanted to know what they are and where you can best use them for. ...

How should I change my Graph structure (very slow insertion)?

Hi, This program I'm doing is about a social network, which means there are users and their profiles. The profiles structure is UserProfile. Now, there are various possible Graph implementations and I don't think I'm using the best one. I have a Graph structure and inside, there's a pointer to a linked list of type Vertex. Each Vertex ...

How can I test that my hash function is good in terms of max-load?

I have read through various papers on the 'Balls and Bins' problem and it seems that if a hash function is working right (ie. it is effectively a random distribution) then the following should/must be true if I hash n values into a hash table with n slots (or bins): Probability that a bin is empty, for large n is 1/e. Expected number o...

Help with hash tables and quadratic probing in Java

I really need help with inserting into a hash table. I'm just not totally getting it right now. Could someone explain quadratic and linear probing in layman's terms? public void insert(String key) { int homeLocation = 0; int location = 0; int count = 0; if (find(key).getLocation() == -1) // make sure key is not alrea...

Bash: Correct way to Iterate over Map

In Bash I can create a map (hashtable) with this common construction hput() { eval "$1""$2"='$3' } hget() { eval echo '${'"$1$2"'#hash}' } and then use it like this: hput capitals France Paris hput capitals Spain Madrid echo "$(hget capitols France)" But how do I best iterate over the entries in the map ?. For instance, in J...

Good Hash Function for Strings

I'm trying to think up a good hash function for strings. And I was thinking it might be a good idea to sum up the unicode values for the first five characters in the string (assuming it has five, otherwise stop where it ends). Would that be a good idea, or is it a bad one? I am doing this in Java, but I wouldn't imagine that would mak...

What exactly are hashtables?

What are they and how do they work? Where are they used? When should I (not) use them? I've heard the word over and over again, yet I don't know its exact meaning. What I heard is that they allow associative arrays by sending the array key through a hash function that converts it into an int and then uses a regular array. Am I right ...

Does it make sense to resize an Hash Table down? And When?

Hi, My Hash Table implementation has a function to resize the table when the load reaches about 70%. My Hash Table is implemented with separate chaining for collisions. Does it make sense that I should resize the hash table down at any point or should I just leave it like it is? Otherwise, if I increase the size (by almost double, actu...

Android Hashtable Serialization

Hi All, I am having a weird issue with serialization of a Hashtable. I have made a Server, Client app. Where server(PC/MAC) is serializing a Hashtable and sending it to Client(Android) through UDP. The data is sent/read correctly but I get a bunch of these messages below on LogCat. 04-12 11:19:43.059: DEBUG/dalvikvm(407): GetFieldID:...