unit 3 aos 1 Flashcards

signature specifications

You may prefer our related Brainscape-certified flashcards:
1
Q

Array

A

Create: int > array
Set: array x int x element -> array
Get: Array x int -> element

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

List

A

Create: -> List
IsEmpty: List -> Boolean
Get: List ×Integer -> Element
Set: List ×Integer ×Element -> List
Insert: List ×Integer ×Element -> list
Delete: List ×Integer -> List

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

Stack

A

Create: -> Stack
IsEmpty: Stack -> Boolean
Push: Stack ×Element -> Stack (put an element in a stack)
Peek: Stack -> Element (see what value is on top of a stack)
Pop: Stack -> Stack (remove the top value from a stack)

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

Queue

A

Create: -> Queue
IsEmpty: Queue -> Boolean
Enqueue: Queue ×Element -> Queue (add element to queue)
Peek: Queue -> Element (returning element on top of a queue)
Dequeue: Queue -> Queue (removes last element in a queue)

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

Priority Queue

A

Create: -> Priority Queue
IsEmpty: Priority Queue -> Boolean
InsertWithPriority (enqueue): Priority Queue ×Element ×Integer -> Priority Queue
GetMin: Priority Queue -> Element
RemoveMin (dequeue_min): Priority Queue -> Priority Queue

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

Dictionary

A

Create: -> Dictionary
HasKey: Dictionary ×Element -> Boolean (if element has key)
Add: Dictionary ×Element ×Element -> Dictionary
Update: Dictionary ×Element ×Element -> Dictionary
Remove: Dictionary ×Element -> Dictionary (the whole set of the key)
Get (key): Dictionary ×Element -> Element

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

Graph

A

Create: -> Graph
AddNode: Graph ×Element -> Graph
AddEdge: Graph ×Element ×Element -> Graph
Adjacent: Graph ×Element ×Element -> Boolean (2 edges see if its next to each other?)
Neighbours: Graph ×Element -> List

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