









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Data Structures Material Type: Notes; Class: OBJECT-ORIENTED PROG II; Subject: Computer Science; University: University of Maryland; Term: Unknown 2007;
Typology: Study notes
1 / 16
This page cannot be seen from the preview
Don't miss anything!










Collection
Examples: roster of students, deck of cards
Represents an aggregation of multiple objects Different kinds of collections
Examples: list, set, ordered set, map, array, tree Supporting different operations on data
Data Structures Taxonomy
Based on relationships between element
Linear
one
one
Hierarchical
one
many
Graph
many
many
Set
none
none
Linear Data Structures
Each element has
unique
predecessor
Each element has
unique
successor
Hierarchical Data Structures
Each element has
unique
predecessor
Each element has
multiple
successors
Example Hierarchical Data Structures
Single root
Multiple roots
Tree with 0–2 children per node
Tree
Binary Tree
Example Graph Data Structures
Undirected edges
Directed edges
Directed edges, no cycles
Undirected
Directed
Set Data Structures
Elements have
no
predecessor / successor
Only
one
copy of element allowed in set
Set B
Set C
Set A
Java Collection Framework (JCF)
Example: List, Set, Map interfaces
Interfaces
Abstract data types
Implementations
Reusable data structures
Algorithms
Reusable functionality
Collection Hierarchy
Collection vs. Collections
Interface Root interface of collection hierarchy Methods: add( ), contains( ), remove( ), size( )
Class Contains static methods that operate on collections Methods: shuffle( ), copy( ), list( )