Abstract Data Types Flashcards

1
Q

what is an ADT

A

describes the desired behaviour in terms of supported operations and their effects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is a data structure

A

describes how data values are stored and operated on. implements one or more ADTs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

give the vector ADT

A

e = element, r = rank = number of elements before

get(r)
insert(r,e)
remove(r)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

give the list ADT

A

simply have elements

first()
last()
after(p)
before(p)
insertBefore(p,e)
insertAfter(p,e)
remove(p)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

give the stack ADT

A
push(o)
pop()
peek() - top object without removing
size()
isEmpty()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

give the set ADT

A
add(o)
remove(o)
find(o)
size()
isEmpty()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

give the dictionary ADT

A

also known as associative array or map

find(k)
insert(k,v)
remove(k)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

give the priority queue ADT

A

insert(k,e)
removeMin()
size()
isEmpty()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly