0% found this document useful (0 votes)
29 views6 pages

Collections

This document summarizes key differences between 1D and 2D data, common Java data structures like List, Set, Map interfaces and their implementations like ArrayList, LinkedList, HashSet, TreeSet, HashMap and TreeMap. It covers properties like ordering, duplicates allowed, speed, functions for each and differences between List vs Set, ArrayList vs LinkedList, HashSet vs TreeSet and HashMap vs TreeMap.

Uploaded by

b36676400
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views6 pages

Collections

This document summarizes key differences between 1D and 2D data, common Java data structures like List, Set, Map interfaces and their implementations like ArrayList, LinkedList, HashSet, TreeSet, HashMap and TreeMap. It covers properties like ordering, duplicates allowed, speed, functions for each and differences between List vs Set, ArrayList vs LinkedList, HashSet vs TreeSet and HashMap vs TreeMap.

Uploaded by

b36676400
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Data

1 Dimensional 2 Dimensional
Allows Data Does not Allows Data
Duplicates Duplicates

List Set Map Interfaces

Array List Linked List Hash Set Tree Set Hash Map Tree Map Classes
List

Array List Linked List


Data 1 Data 2 Data 3 Data 4

Start
Node

Data1 Link Data 2 Link Data 3 Link Data 4 Link

[Data 1, Data 2, Data 3, Data 4]


Difference between List and
Set
Property List Set
Ordered Collection
Ordering of Data (Follows Insertion Order) Unordered Collection
Implementations Array List, Linked List HashSet, TreeSet
Duplicate Values Allows Duplicates Don’t allows Duplicates
Allows any number of null Hashset only allows Null
Null Values values Value (Only one)
In addition to the methods
Set follows and defines only
defined in Collections, list
Method Usage the methods that are
defines some of it’s own
methods defined in the Collection
Differences between Array List and Linked List

Property Array List Linked List


Implements List Interface List Interface
Data Manipulation Slow Comparatively Fast
On removal of data Bits shift in Memory No Bit shifting in Memory
For Storing and Accessing of
Advantage Data For manipulation of Data
Duplicate Data Allows Duplicate Data Allows Duplicate Data
Same as the Input Same as the Input
Ordering of Data
(Follows the Insertion order) (Follows the Insertion order)
Differences between HashSet and TreeSet
Property HashSet TreeSet
Implements Set Interface Set Interface
Natural Order
Ordering of Data Random Order (Ascending Order)
Doesn’t allows Null Values,
When try to Input the Null
Null Value(Data Storage) Allows only one Null Value Value it’ll throw Null Pointer
Exception
Speed Comparatively fast Slow
Rich Number of Functions
Functionality Comparatively less enabled
Duplicate Data Don’t Allows Duplicate Data Don’t Allows Duplicate Data
Differences between HashMap and TreeMap

Property HashMap TreeMap


Implements Map Interface Map Interface
Natural Order of Key
Ordering of Data Random Order (Ascending Order of Key)
Allows only one Null Key and many Doesn’t allow even a Single Null Key
Null Keys and Null Values Null Values but may allows many Null Values
Speed Comparatively fast Slow
Functionality Comparatively less Rich Number of Functions enabled

You might also like