hi,
every collection are having almost same features and efficencey but
with one or two difference which differenceate them.
so which collection is having all the best features?
Garg
Chris Dollin - 27 Nov 2007 10:45 GMT
> every collection are having almost same features
!?
> and efficencey but
!!
> with one or two difference which differenceate them.
>
> so which collection is having all the best features?
None of them; "best" is context-dependent.

Signature
Chris "which oil is best?" Dollin
Hewlett-Packard Limited registered office: Cain Road, Bracknell,
registered no: 690597 England Berks RG12 1HN
phi - 27 Nov 2007 11:00 GMT
> hi,
>
[quoted text clipped - 4 lines]
>
> Garg
Have a Look at the TreeList
http://commons.apache.org/collections/api-3.1/org/apache/commons/collections/lis
t/TreeList.html
to get a very powerfull collection. (But chris dollin is right: there
are several reasons to get the one or the other collection).
I have collected the features of Collections here (german, sorry, no
english version yet):
http://www.santis.ch/training/java/javasyntax/collections.php
phi
Patricia Shanahan - 27 Nov 2007 14:16 GMT
> hi,
>
[quoted text clipped - 4 lines]
>
> Garg
None of them. If it were possible to write a single Collection that was
optimal for every use, there would be only one Collection in java.util.
However, there are some you can effectively ignore. You should generally
use ArrayList in preference to Vector and HashMap in preference to
Hashtable.
Write you code using the most general applicable types for variables:
List<String> someList = new ArrayList<String>();
to keep open the possibility of using a different implementation later.
Patricia
Andreas Leitgeb - 27 Nov 2007 16:49 GMT
>> every collection are having almost same features and efficencey but
>> with one or two difference which differenceate them.
>> so which collection is having all the best features?
> None of them. If it were possible to write a single Collection that was
> optimal for every use, there would be only one Collection in java.util.
But I want a collection that's best in all
that's fast to save and fast to recall,
that's fast for insert and fast for remove
at any position, of course, to be smooth,
That's fast for sorting and fast for searchin',
because my searches are always urgin'
It shouldn't take memory more than what's in it,
and allow the gc to clean, where I sinned,
Best thing is, you can have it all,
unless you insist on elements' recall.
Christian - 27 Nov 2007 18:25 GMT
Garg schrieb:
> hi,
>
[quoted text clipped - 4 lines]
>
> Garg
look here:
http://en.wikibooks.org/wiki/Data_Structures/Tradeoffs
there are the sympthotic runtimes of at least some data structures listed..
---
What do you want to use the collection for?
Roedy Green - 28 Nov 2007 05:41 GMT
>every collection are having almost same features and efficencey but
>with one or two difference which differenceate them.
>
>so which collection is having all the best features?
That is liking which person makes the best wife. It is something only
you can answer because only you know what is important to you.
What do you want to use the Collection for?

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Manish Hatwalne - 28 Nov 2007 15:21 GMT
> hi,
>
> every collection are having almost same features and efficencey but
> with one or two difference which differenceate them.
>
> so which collection is having all the best features?
A lot depends on what you want to do! What do you want to do - each
collection type is more suitable for a specific purpose, so your purpose
will pick the collection
List type - sequence
Set type - unique elements
Map - mapping of two objects
so what do you want to do?