Unit 2- Part 2 Flashcards
(51 cards)
What does an ADT represent?
the ways of organizing data in a computing environment
What does an ADT provide?
provides a specification of:
-a set of data that is stored
-a set of operations that can be performed on the data
How are data structures realized?
-by implementing ADTs within a programming language
What ADT mean?
Abstract Data Type
What is Hashing?
-A technique that determines a storage index or location for storing an item in a data structure
What does a hash function do?
-Receives the search key and returns the index of an array where the search key is stored
What would a perfect hash function do?
maps each search key into an index of the hash table
The Set interface extends what?
extends the Collection interface
define Collection
An ADT that contains a group of objects/items
define Container
a class that implements the collection
List the different types of ADTs
-Bag
-List
-Stack
-Queue
-Dictionary
-Tree
-Graph
What is the Bag ADT?
-Unordered collection, may contain duplicates
What is the List ADT?
-A collection that numbers (first, second so on) its items
What is the Stack ADT?
Orders items sequentially
-Last In, First Out
What is the Queue ADT?
-Orders items sequentially
-First In, First Out
What is the Dictionary ADT?
Pairs of items (key and value)
-Can be sorted or not
What is the Tree ADT?
Arranged in a hierarchy
What is the Graph ADT?
Generalization of a tree
What are the three types of collections that Java Collections Framework supports?
-Sets
-Lists
-Queue
What does the Set interface require?
that an instance of Set contains no duplicate elements
-No two elements e1 and e2 can be in a set such that e1.equals(e2) is true
What is the AbstractSet class?
-abstract class that extends AbstractCollection, implements toString() method, and implements Set
what does the AbstractSet class provide?
-concrete implementations for the equals() and the hashCode() methods
What is the hash code of a set?
the sum of the hash codes of all the elements in the set
what is the HashSet class?
a concrete class that implements Set