click below
click below
Normal Size Small Size show me how
Stacks & Queues
Question | Answer |
---|---|
A ___________ is a data structure in which the items are added and deleted from one end only (the top). | stack |
A stack is a ___________ data structure. | Last In First Out (LIFO) |
The basic operations on a stack are as follows: • ___________ an item onto the stack • ___________ an item from the stack • ___________ at the top element of the stack • check whether the stack is ___________ | push pop peek empty |
A stack can be implemented as an ___________ or a ___________. | array linked list |
The middle elements of a stack should ___________ be accessed directly. | not |
A ___________ is a data structure in which the items are added at one end (the back) and removed from the other end (the front). | queue |
A queue is ___________ data structure. | First In First Out (FIFO) |
The basic operations on a queue are as follows: • ___________ an item to the queue • ___________ an item from the queue • ___________ at the first element in the queue • ___________ the queue • check whether the queue is ___________ | add, remove, peek at, initialize, empty |
A queue can be implemented as an ___________ or a ___________. | array, linked list |
The middle elements of a queue should ___________ be accessed directly. | not |