It is currently Fri May 18, 2012 4:27 pm


Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Hashmap and Hashtable
PostPosted: Sat Aug 28, 2010 5:03 pm 
Site Admin

Joined: Sat Aug 02, 2008 8:00 am
Posts: 147
A hash map or hash table is a structured data which uses a hash function to for identifying values, which are known as keys. For example an individual’s name. These values are then associated to their values like hand phone number, house address etc. Function of the hash key is the transformation of keys to the index of an element where the related value needs to be sought. In other words a hash table or hash map can be defined as a collection which allows a set of objects for treating them as one unit. Among the java collection frame work, hash table is one core interface. It defines the operations to maintain mappings of keys to their respective and related values.
Hash map interface never implement any collections interface. This is because they does not contain any elements, at the same time they have entries of the keys and their respective or related values. This process is called mapping. Mapping also doesn’t allow key duplication. Hence there will be only one value which is mapped with a particular key. Both these keys and respective value must be entered as objects. Hash table contains map interface. It is very important in java frame work. The table automatically grows when you keep on adding elements. The more you add the bigger the table in size. The growing process of a hash table is largely determined by rehashing and copying. The rechaining also affects the process. All of the above affects the overall performance.
Performance of hash table or hasp map again depends upon two other factors known as load factor and Initial capacity. The established capacity at the time of hash table creation is called as initial capacity. It is the duty of the load factor to determine when to increase the capacity of the hash table. The default load factor is normally .75. The initial capacity is not necessarily the number of elements that you need to store inside the hash table. The ideal function of the hash table in general is to map each of the possible keys to one unique index. But this one thing is very rare to happen. In a good dimensioned table the cost for single look up will be independent of the element density in the table. Many tables have possible deletion and addition options for keys and values.
In general hash table or hash map is very important in the application of caches, sets, unique data representation and data representation in the real world.

_________________

Muhammad Safwat Fuad
The Java Code Admin
Java Technical Lead.
Mobile: +2010-2942-538
Email:mtv134@yahoo.com


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Registered users: europhory


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
twilightBB Style by Daniel St. Jules of Gamexe.net

[
SEO MOD © 2007 StarTrekGuide ]