tag:blogger.com,1999:blog-8712770457197348465.post2190000861491098375..comments2024-03-29T00:43:22.798-07:00Comments on Javarevisited: Difference between HashMap, LinkedHashMap and TreeMap in Java with Examplejavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-8712770457197348465.post-82141437233879224742017-06-07T05:24:28.742-07:002017-06-07T05:24:28.742-07:00Hello Nitin, they are definitely part of Java Coll...Hello Nitin, they are definitely part of Java Collection framework, its just that they don't implement Collection interface. javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-75951833891244558992017-06-07T00:48:44.713-07:002017-06-07T00:48:44.713-07:00"The java.util.Map is one of the most importa..."The java.util.Map is one of the most important interfaces from Java Collection Framework." As per my understanding Maps are not part of java collection framework.<br /><br />Anonymoushttps://www.blogger.com/profile/15952663545588365645noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-1566710955605833032016-07-19T12:25:28.592-07:002016-07-19T12:25:28.592-07:00GReat article with great info:) Thank you Javin:)GReat article with great info:) Thank you Javin:)GOPIhttps://www.blogger.com/profile/09541394969420706105noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-60545586346127973762016-01-09T15:13:12.827-08:002016-01-09T15:13:12.827-08:00@Unknown, Thanks for spotting that error. You are ...@Unknown, Thanks for spotting that error. You are right, TreeMap doesn't provide constant time operation, instead it guaranteed log(n) time cost for get, put, containsKey and remove operation. javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-27831408172008068232016-01-09T13:12:46.877-08:002016-01-09T13:12:46.877-08:00“TreeMap provides you sorting, on top of hashing o...“TreeMap provides you sorting, on top of hashing offered by Map interface, which means you can not only retrieve elements in constant time i.e. O(1) time, but also iterate through those mapping in a predefined sorted order”<br />TreeMap doesn't allow to extract element in constant time.Kapibarahttps://www.blogger.com/profile/06507675606711672880noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-33556247728676513362016-01-06T07:36:04.953-08:002016-01-06T07:36:04.953-08:00"HashMap allows you to retrieve object in O(1..."HashMap allows you to retrieve object in O(1) time, if you know key."<br />That's only true if you have some perfect hashing function. Worst case is O(n). But on average it really is near constant. <br />Another concurrent implementation is ConcurrentSkipListMap. It can be used like a TreeMap. Anonymoushttps://www.blogger.com/profile/03796270893631582541noreply@blogger.com