Given the following code:
Hashtable main = new Hashtable();
Hashtable inner = new Hashtable();
ArrayList innerList = new ArrayList();
innerList.Add(1);
inner.Add("list", innerList);
main.Add("inner", inner);
Hashtable second = (Hashtable)main.Clone();
((ArrayList)((Hashtable)second["inner"])["list"])[0] = 2;
Why does the value with...
Hello,
what is the running time (big Oh) for linear probing on insertion, deletion and searching.
Thanks
...
Quick question of does Windows CE support hash tables? I have a program that I'm modifying and adding to a device that uses Windows CE and I was wondering if CE supported hash tables since it is used in the original software.
...
Guys, I have a data structure which has 25 distinct keys (integer) and a value. I have a list of these objects (say 50000) and I intend to use a hash table to store/retrieve them. I am planning to take one of these approaches.
Create a integer hash from these 25 integer keys and store it on a hash table. (Yeah! I have some means to han...
Hi,
Right now my hash tables count the number of every element inserted into the hash table. I use this count, with the total hash table size, to calculate the load factor and when it reaches like 70%, I rehash it.
I was thinking that maybe I should only count the inserted elements with fills an empty slot instead of all of them. Cause...
Hi there,
I'm trying to build a GHashTable of instances of a struct containing ints, a time_t and a few char*'s.
My question is, how do you insert an instance of a struct into a GHashTable? there are plenty of examples of how to insert a string or an int (using g_str_hash and g_int_hash respectively), but I'm guessing thatI want to use...
HashSet<T> t = new HashSet<T>();
// add 10 million items
Dictionary<T, K> t = new Dictionary<T, K>();
// add 10 million items.
Whose .Contains method will return quicker?
Just to clarify, my requirement is I have 10 million objects (well, strings really) that I need to check if they exist in the Data Structure. I will NEVER iterate....
hi,
I'm looking for a hashtable implementation in C that stores its objects in (twodimensional) arrays rather than linked lists.
i.e. if a collision happens, the object that is causing the collision will be stored in the next free row index rather than pushed to the head and first element of a linked list.
plus, the objects themselves ...
I am trying to use Horner's rule to convert words to integers. I understand how it works and how if the word is long, it may cause an overflow. My ultimate goal is to use the converted integer in a hash function h(x)=x mod tableSize. My book suggests, because of the overflow, you could "apply the mod operator after computing each pare...
I have created a program using the built in java.util.hashtable but now I need to resolve collisions using separate chaining. Is it possible with this implementation of a hashtable? Is there one out there already implemented that uses separate chaining?
...
hello,
I'm trying to figure out how to build a multi-dimensional "array" that is:
flexible size
use 2 keys
1st key is int (flexible)
2nd key is string (kind of limited)
The use will be like:
console.writelen(array[0]["firstname"]);
console.writelen(array[0]["lastname"]);
console.writelen(array[0]["phone"]);
console.writelen(array[...
I have written a program to store a bunch of strings in a JFC hash table. There are defiantly collisions going on, but I don't really know how it is handling them. My ultimate goal is to print the number of occurrences of each string in the table, and traversing the bucket or list would work nicely. Or maybe counting the collisions? O...
It seems to be common knowledge that hash tables can achieve O(1) but that has never made sense to me. Can someone please explain it?
A. The value is an int smaller than the size of the hash table, so the value is its own hash, so there is no hash table but if there was it would be O(1) and still be inefficient.
B. You have to calcu...
Hi all .
I have hastable
htmlcontent is html string of urlstring .
I want to write hastable into a .text file .
Can you suget me a sulution ?
...
What is a good C++ library for hash tables / hash maps similar to what java offers. I have worked with Google Sparsehash, but it has no support for collisions.
...
I have hashtable, my program want to record the valuse of hashtable to process later!
But i have a quesiton . Can web write oject hastable in to file ? if can,how to load that file ?
...
I was wondering how Java orders items in the Map (HashMap or Hashtable) when they are added. Are the keys ordered by the hashcode, memory reference or by allocation precedence...?
It's because I've noticed same pairs in the Map are not always in the same order
...
I want to create a hashtable of json objects, where each json object represents a user.
I want to do this to sort of create a client side 'cache' of users.
User { ID: 234, name: 'john', ..);
So I can then reference things like this:
if(userCache[userid] != null)
alert(userCache[userid].ID);
is this possible?
...
What I need is something like Hashtable which I will fill with prices that were actual at desired days.
For example: I will put two prices: January 1st: 100USD, March 5th: 89USD.
If I search my hashtable for price: hashtable.get(February 14th) I need it to give me back actual price which was entered at Jan. 1st because this is the ...
Hi, I have a C programming question on the implementation of a hash table. I have implemented the hash table for storing some strings.
I am having a problem while dealing with hash collisons. I am following a chaining linked-list approach to overcome the problem but, somehow, my code is behaving differently. I am not able to debug it. Ca...