Working with C#, I loved the feature of the data-type : Dictionary. I was wondering how we can implement a Dictionary in C++.
Heres what could be a way out...
1. Following the C# implementation as the model, we create a class having two elements : key and value, and implement it as a doubly linked-list. This will optimize structure parsing of the dictionary.
2. We can use Templates to make it a case with generic key and value types.
3. Another internal optimization would be to use hash.
4. Sort the dictionary based on the key values.
5. Provide functions to set and unset key-value pair.
--As I noticed that dictionary is immutable during access, provide a stack say _keys_to_delete on top of which we can push the keys of entries to be deleted. Implement a garbage collection of sorts that runs a loop to delete the entries based on the keys found in the stack _keys_to_delete after the dictionary has finished iterative access (so that it again becomes mutable)...
Microsoft launches DreamSpark in India!
-
On 5th November 2008, Microsoft unveiled *DreamSpark* - a software giveaway
for an estimated 10 million eligible students in India. DreamSpark will
provi...

14 comments:
typedef map < string, string > Dictionary;
typedef std::map <string, string> Dictionary;
recommend you to look at this - http://code.google.com/p/google-sparsehash/
this is hash map
First I want to congratulate you for this amazing blog!
We Are Pleased To Announce The Launch Of Movies Gallery 08, Mobile Movies in 3gp format, Reality show, Funny Video, Upcoming Movies 08 Trailer, About Dubai,Real Estate, Tips Of Career And Many More.
To start just go to http://moviesvideo.blogspot.com/
We hope you like it. Please send us any feedback on the movies and help us improve the sites further.
Hello.. Do you know how to Add Adsense Code Inside Single Post Only in XML Template? Visit your blog to learn how.. Have a nice thursday!
Download Full Version Software at AriesGames... http://ariesgames.blogspot.com
Cool Stuff, can you check out my C++ Code Samples too?
muy interesante su articulo! :):):):):):)
like jose already said, you are talking about a hashmap and it's been in the stl since the very beginning...
I think std::map does a good job...
telecharger turbo c gratuit
turbo c logiciel gratuit
thanx for the information..more more details visit www.studentluv.com
Thank you for your whole labor on this web page. I love working on research and it’s really simple to grasp why. I notice all of the dynamic mode you present both useful and interesting tricks through this blog and therefore encourage contribution from other ones on the concept. Without a doubt i become educated in lot of things.
external hard drive recovery
Post a Comment