Collections
When java is introduced, it was open source, and anyone can contribute.
From java 1.2, collection framework is available. before that it is not there.
=>Under Collection hierarchy there are 7 classes
Array List: It is implementing List interface. It is suitable at the insertion at the rear end.
Linked List: It is implementing List as well as deque interface. It is suitable at the insertion at any end.
Array deque: It is implementing deque interface which extends queue interface. It is suitable at the insertion at the rear and backend
Priority deque: Automatically high priority element is available at the beginning of the collection. It is suitable at the insertion at the backend.
Tree set: It will give you in the sorted order and it is also suitable for the searching operation if and only if the tree is balanced binary search tree. and in case of skewed tree searching operation is not recommended.
Hash set: order of insertion is not maintained and searching operation is fast. Internally it follows hashing algorithm, and it uses hashing function and hashing table to store the data.
Linked Hash set: Order of insertion is maintained and searching operation is fast. Internally it follows hashing algorithm, and it uses hashing function and hashing table to store the data. It was introduced later in the collection API in the java 1.4.
Comments
Post a Comment