Stack and Queue Flashcards

1
Q

Stack can be implemented with

A

either array and linked-list

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

time of stack operation

A
all o(1)
(push, pop, top, isEmpty)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

If you implement stack with array

A

new item is inserted at the end of array

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

If you implement stack with linked-list

A

new item is inserted at the front of linked-list

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

stack is LIFO / FIFO ?

A

LIFO

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

stack pop removes most recently added item or least recently added item?

A

removes the most recently added item

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

queue is LIFO / FIFO?

A

FIFO

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

queue dequeue removes most recently added item or least recently added item?

A

least recently added item

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

queue can be implemented with

A

array or a linked list with tail

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

time of queue operation

A

o(1)

enqueue, dequeue, isempty

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