2.3.1 Flashcards

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

What structure are stacks?

A

FILO

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

Which function adds an item to a stack

A

Push

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

Which function removes an element from a stack

A

Pop

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

What does the back pointer in a queue do?

A

Holds the location of the next available space in the queue

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

Which function returns the item at the front of a queue without removing it

A

Peek

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

What is the purpose of the front pointer in a queue

A

Points to the space containing the first item in the queue

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

What value is the top pointer of a stack initialised as

A

-1

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

Pseudocode to add an item to a stack

A

push(element)
top += 1
A[top] = element

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

Pseudocode to add an item to a queue

A

enqueue(element)
A[back] = element
back += 1

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

What is a procedural programming language

A

High-level language
Gives a series of instructions in a (logical)
order / line by line / what to do and how to
do it

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