Stacks and queues with templates and expectation handling Flashcards

1
Q

what is stack

A

Collection of objects that are inerted/ removed according last in first out principle

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

main stack operations

A

Push - inserts element on top
Pop- removes last element
getTop- return last inserted element
Size
Is empty

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

array based stack properties

A

Add elements from left to right
Remove elements from right to left
Variables keeps track of index of last item pushed

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

linked list stack Properties

A

Remove the size restrictions
Head points to nul
Push-isert head
Pop- remove head

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

qhat is queue ADT

A

-is a collection of objects inserted and removed according to the first in first out principle
- objects are inserted at the rear of the queue
-objects can only be removed from the front of the queue

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