Collections algorithms

What are the algorithms used by the collections.
[55 byte] By [csreddy33a] at [2007-9-30 1:20:24]
# 1
I don't know whether or not the algorithms are published but you can always look at the source code which comes with the Java distribution.
sabre150a at 2007-7-16 5:56:38 > top of Java-index,Other Topics,Algorithms...
# 2
In what sense do the collections use algorithms? They're data structures. I suppose you could argue over whether tree rebalancing (as in TreeMap) is an algorithm, but apart from that I can't see anything algorithmic about them.
YATArchivista at 2007-7-16 5:56:38 > top of Java-index,Other Topics,Algorithms...
# 3
Also binary search, when looking for something in a sorted array. *shrug*
volley_sea at 2007-7-16 5:56:38 > top of Java-index,Other Topics,Algorithms...
# 4

> In what sense do the collections use algorithms?

> They're data structures. I suppose you could argue

> over whether tree rebalancing (as in TreeMap) is an

> algorithm, but apart from that I can't see anything

> algorithmic about them.

LinkedList is a Collection and has several algorithms associated with inserting and deleting. OK they are not very complicated but they are algorthms.

SortedSet is a Collection and again has algorithms for inserting and deleteting.

Yes, each collection type has a different underlying data structure but then all the major methods have algorithms of implementation.

sabre150a at 2007-7-16 5:56:38 > top of Java-index,Other Topics,Algorithms...
# 5

Most of the algorithms or techniques used in the Collections package are described in the API

documentation. Often where the subject is a bit more complex the API provides a reference to work that

describes the approach used.

If there is not enough info for you in the API then look at the source code. There are occasionally comments

in the source that name the algorithm or reference the originator of the idea.

matfud

matfuda at 2007-7-16 5:56:38 > top of Java-index,Other Topics,Algorithms...
# 6

Well, this page might help:

http://java.sun.com/developer/onlineTraining/collections/Collection.html

http://java.sun.com/docs/books/tutorial/collections/algorithms/

Complete Collection of Algorithm Animations

http://www.cs.hope.edu/~alganim/ccaa/

Java Applets for Data Structures and Algorithms

http://www.cosc.canterbury.ac.nz/people/mukundan/dsal/appldsal.html

Open Directory - Computer Algorithms links

http://dmoz.org/Computers/Algorithms/

rkconnera at 2007-7-16 5:56:38 > top of Java-index,Other Topics,Algorithms...