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