1.4.2 Data structures Flashcards

1
Q

what is an array?

A

an ordered, finite set of elements of a single type

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

what is a list?

A

a data structure consisting of a number of items, where the items can occur
more than once

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

what is a stack?

A

a last in first out data structure, where items can only be removed from and added to the top of the list

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

what is a queue?

A

a first in first out data structure, where items are added to the end of the queue and removed from the front of the queue

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

what does the operation isEmpty() do?

A

checks to see if the stack is empty

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

what does the operation push(value) do?

A

adds a new value to the top of the stack

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

what does the operation peek() do?

A

returns the top value of the stack
without removing it

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

what does the operation pop() do?

A

returns and removes the value at the top of the stack

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

what does the operation size() do?

A

it returns the size of the stack

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

what does the operation isFull() do?

A

checks to see if the stack is full

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

what does the operation
enQueue(value) do?

A

adds the value to the end of the queue

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

what does the operation deQueue() do?

A

removes the item from the end of the queue

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

what does the operation isEmpty() do?

A

it checks to see if the queue is empty

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