It is currently Fri May 18, 2012 5:52 pm


Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: String buffer and hash map
PostPosted: Mon Aug 30, 2010 6:56 pm 
Site Admin

Joined: Sat Aug 02, 2008 8:00 am
Posts: 147
Before going to string buffer, we talk about string first. String is the sequence of symbols or characters. It is essential in computer programming as it is a data type which stores the sequence of data values, normally in bytes. The bytes stand for a character according the character encoding. String buffer is the alternative for the string. As we known, string is mutable or unchangeable. The length of the characters is fixed and exact where no external length for it. This shows that when we want to make any modification on the sequence of characters, we have to create a new string to replace it. More time and resources wasted when we doing the modification or changes for it.
In order to solve this problem, string buffer is created. It claims that the performance would be better. The reason is string buffer does not require the exact and precise length of characters; it can have the longer length for it. Hence, any adding, modification, changes or removing can be done within the extra length of the sequence of characters. Subsequently, it improves the performance and minimizes the resources and time.
Hash map is called as hash table which is a data structure. It uses the hash functions in mapping identified values which called as a key to their associate values. For example, it means linking the key such as person name to their address which is the associate values. Hash functions defined as mathematical function which converting or transforming a large or enormous amount of data into datum where serves as an index to an array or sequence of data.
It aims to spread out the key-value pairs with each bucket which contains few key-value pairs. When looking for the item, key is hashed to find the appropriate associate value. There will be the hash collisions where different keys would have the same associates or hash values. It is the normal occurrences and unavoidable when dealing with a large set of possible keys. There are few strategies can be used in order to solve the hash collisions, such as separate chaining and open addressing. Why using the hash tables? Firstly, the speed would be advantage when dealing with enormous number of entries. It is efficiently in allocation the bucket array. While if there is a fixed or known for the set of key-values, the average lookup cost or number of instructions will be reduced.
As a conclusion, both are basic components in building a software which in first writing data or source code and subsequently linking each data value where link together. The efficiency of using both components would help in reduction of resources.

_________________

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, Google [Bot]


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 ]