بازگشت   پی سی سیتی > کامپیوتر اینترنت و شبکه Computer internet > سیستم عامل > ویندوز windows > مقالات آموزش ترفندها... Traning > مقایسه ها > مبانی نرم افزار

پاسخ
 
ابزارهای موضوع نحوه نمایش
  #1  
قدیمی 05-09-2013
DifferenceBetween آواتار ها
DifferenceBetween DifferenceBetween آنلاین نیست.
ربات اتوماتیک
 
تاریخ عضویت: May 2013
نوشته ها: 108
سپاسها: : 0

0 سپاس در 0 نوشته ایشان در یکماه اخیر
پیش فرض مقایسه تفاوت های Differences Between HashMap and TreeMap

مقایسه تفاوت های Differences Between HashMap and TreeMap


HashMap vs TreeMap

HashMap in simple terms is a structuring form where data can easily be linked to a unique identification number and symbol. HashMap is also commonly referred to as the hash table. In making use of the HashMap, it is quite easy to retrieve data from a large database that may comprise thousands or even millions of entries. It is quite important to note that HashMap does not constitute any part of the program but is a data organization method. In this organization, each item is assigned by HashMap a key in the database. The key is assigned a corresponding value in the database which defines a specific item.

A TreeMap, on the other hand, is a data visualization method that is gaining popularity online by the day. TreeMap is simply a hierarchical representation of information in a series of different rectangular dimensions, all which add up to represent a whole item. The size of each box represents a given quantity and the color a given value. Each level of the hierarchy of TreeMap is a direct representation of the dataset that has been entered into the data table. An individual rectangle is a representation of a category in the hierarchy. To create TreeMap, different algorithms can be exploited to create the one, final TreeMap that is desired. TreeMap helps designers in representing different information on the same screen.

Both HashMap and TreeMap perform more or less the same function. The main difference that is observed between the two is that HashMap is faster and TreeMap is slower. This main difference is quite evident when there are large databases being run, especially with items in excess of thousands. In the event you ask TreeMap to list all the keys in it (calling ketSet().iterator()), it produces the keys sorted out in order. This, in effect, suggests that the keys are implemented using a comparable interface, or there is a need to produce a comparator to create a TreeMap. HashMap, on the other hand, will require that the different keys available are overridden. These keys are the HashMap () and equals (). The overriding methods must, however, be done in a sensible way. The same tendency is noted when inserting data in that HashMap is faster while TreeMap lags slightly.

Another difference shown is that TreeMap executes its function on a sorted map allowing you to review the contents through a process of iterations. In this, you get to check the order of contents being sorted out either by their virtue of being in their natural order or by use of a comparator that was defined during the TreeMap creation process. When using HashMap, iterations of content can bring about any order reorganization, and this is not desired as the order that data was entered in the map is not conformed with. When using HashMap, null keys are allowed as a valid value. However, TreeMap values do not allow for the use of null values. Also, you can use differing keys in HashMap while TreeMap only allows for use of similar types of keys.

Summary:

- Data insertion and retrieval is faster in HashMap as opposed to TreeMap, especially in large datasets.

- The best alternative to use if order is not desired is HashMap.

- HashMap is unordered and should be used only in cases where data order is not a crucial factor.

- TreeMap offers iterative checks and creates order.

- HashMap allows null keys while TreeMap doesn’t allow them.

- HashMap allows the use of differing keys while TreeMap allows for the use of different types of keys.    


You might also like…



پاسخ با نقل قول
جای تبلیغات شما اینجا خالیست با ما تماس بگیرید




پاسخ


کاربران در حال دیدن موضوع: 1 نفر (0 عضو و 1 مهمان)
 

مجوز های ارسال و ویرایش
شما نمیتوانید موضوع جدیدی ارسال کنید
شما امکان ارسال پاسخ را ندارید
شما نمیتوانید فایل پیوست در پست خود ضمیمه کنید
شما نمیتوانید پست های خود را ویرایش کنید

BB code is فعال
شکلک ها فعال است
کد [IMG] فعال است
اچ تی ام ال غیر فعال می باشد



اکنون ساعت 12:02 PM برپایه ساعت جهانی (GMT - گرینویچ) +3.5 می باشد.



Powered by vBulletin® Version 3.8.4 Copyright , Jelsoft Enterprices مدیریت توسط کورش نعلینی
استفاده از مطالب پی سی سیتی بدون ذکر منبع هم پیگرد قانونی ندارد!! (این دیگه به انصاف خودتونه !!)
(اگر مطلبی از شما در سایت ما بدون ذکر نامتان استفاده شده مارا خبر کنید تا آنرا اصلاح کنیم)


سایت دبیرستان وابسته به دانشگاه رازی کرمانشاه: کلیک کنید




  پیدا کردن مطالب قبلی سایت توسط گوگل برای جلوگیری از ارسال تکراری آنها