-
as seen on Stack Overflow
- Search for 'Stack Overflow'
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…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Say we have a hashtable of size m, and at each bucket we store a hashtable of size p.
What would the worst case/average case search complexity be?
I am inclined to say that since computing a hash function is still atomic, the only worst case scenario is if the value is at the end of the linked list…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi All,
I am trying to fix the size of the Hashtable with following code.
Hashtable hashtable = new Hashtable(2);
//Add elements in the Hashtable
hashtable.Add("A", "Vijendra");
hashtable.Add("B", "Singh");
hashtable.Add("C", "Shakya");
hashtable.Add("D"…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
In this hashing routine:
1.) I am able to add strings.
2.) I am able to view my added strings.
3.) When i try to add a duplicate string, it throws me an error saying already present.
4.) But, when i try to delete the same string which is already present in hash table,
then the lookup_routine…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi guys i've never written a comparator b4 and im having a real problem. I've created a hashtable.
Hashtable <String, Objects> ht;
Could someone show how you'd write a comparator for a Hashtable? the examples i've seen overide equals and everything but i simply dont have a clue. The code…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
const jonny1 : Person = new Person("jonny", 26);
const jonny2 : Person = new Person("jonny", 26);
const table : Dictionary = new Dictionary();
table[jonny1] = "That's me";
trace(table[jonny1]) // traces: "That's me"
trace(table[jonny2]) // traces: undefined.
But I want use Dictionary like this…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi All !
I have hashmap and its keys are like "folder/1.txt,folder/2.txt,folder/3.txt" and value has these text files data.
Now i am stucked. I want to sort this list. But it does not let me do it :(
Here is my hashmap data type:
HashMap<String, ArrayList<String>>
following function…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi! I have a HashMap where the key is a word and the value is a number of occurrences of that string in a text. Now I'd like to reduce this HashMap to only 15 most used words (with greatest numbers of occurrences). Do you have any idea to do this efficiently?
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
I'm using a recursive tree of hashmaps, specifically Hashmap map where Object is a reference to another Hashmap and so on. This will be passed around a recursive algorithm:
foo(String filename, Hashmap<String, Object> map)
{
//some stuff here
for (Entry<String, Object> entry…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have the following structure:
HashMap< String, HashMap< String, String
Now i want to know the last accessed element in the 2nd dimension.
I know there is TreeMap which makes sense in the 1rst dimension but after that it doesn't make any sense.
How can I keep track of a 2D HashMap ordering…
>>> More