6/12/141 /XX N: C U TC D LI U GV: NGUY N XUÂN VINH
COLLECTIONs FRAMEWORK
Nguy n Xuân Vinh
nguyenxuanvinh@hcmuaf.edu.
vn
C U TRÚC D LI U
DATA STRUCTURES
[214441]
6/12/142 /XX N: C U TRÚC D LI U GV: NGUY N XUÂN VINH
Introduction to Collections
Acollection—sometimescalledacontainer—issimplyanobject
thatgroupsmultipleelementsintoasingleunit.
Collectionsareusedtostore,retrieve,manipulate,and
communicateaggregatedata.
Representdataitemsthatformanaturalgroup,suchas:
Apokerhand(acollectionofcards)
Amailfolder(acollectionofletters)
Atelephonedirectory(amappingofnamestophonenumbers)
6/12/143 /XX N: C U TRÚC D LI U GV: NGUY N XUÂN VINH
What is a Collections Framework
Acollections frameworkisaunifiedarchitectureforrepresenting
andmanipulatingcollections.
Allcollectionsframeworkscontainthefollowing:
Interfaces:Theseareabstractdatatypesthatrepresent
collections
Implementations:Thesearetheconcreteimplementationsof
thecollectioninterfaces.
Algorithms:Thesearethemethodsthatperformuseful
computations,suchassearchingandsorting
6/12/144 /XX N: C U TRÚC D LI U GV: NGUY N XUÂN VINH
Collections Interface
6/12/145 /XX N: C U TRÚC D LI U GV: NGUY N XUÂN VINH
Collections Implementations