Abstract Data Types Flashcards
1
Q
what is an ADT
A
describes the desired behaviour in terms of supported operations and their effects.
2
Q
what is a data structure
A
describes how data values are stored and operated on. implements one or more ADTs
3
Q
give the vector ADT
A
e = element, r = rank = number of elements before
get(r)
insert(r,e)
remove(r)
4
Q
give the list ADT
A
simply have elements
first() last() after(p) before(p) insertBefore(p,e) insertAfter(p,e) remove(p)
5
Q
give the stack ADT
A
push(o) pop() peek() - top object without removing size() isEmpty()
6
Q
give the queue ADT
A
enqueue(o) - insert object at reer
dequeue()- remove and return front object
peek() - return front object without returning
size()
isEmpty()
7
Q
give the set ADT
A
add(o) remove(o) find(o) size() isEmpty()
8
Q
give the dictionary ADT
A
also known as associative array or map
find(k)
insert(k,v)
remove(k)
9
Q
give the priority queue ADT
A
insert(k,e)
removeMin()
size()
isEmpty()