Question: This is python programming. Please answer the questions based on python programming. 1.Answer True/False for the following statements (4 points each): a. The Stack follows
This is python programming. Please answer the questions based on python programming.
1.Answer True/False for the following statements
(4 points each):
a. The Stack follows the LILO principle.
b. The Queue follows the FIFO principle
c. The Deque follows the FILO principle.
d. The Stack needs two references to achieve a worst case complexity of O(1).
e. The Queue needs two references to achieve a worst case complexity of O(1).
f. The Stacks always adds a node to the top.
g. The Queue always adds a node to the top.
h. The Deque only adds to one place in the structure.
i. The Deque can remove any node in the structure, the first, last or any middle node.
j. The Deque is considered a hybrid of the stack.
2. Demonstrate the following operations on an empty stack. DO NOT simply show the final stack diagram, show what the stack looks like after each operation.
a. Push(20)
b. Push(30)
c.Pop()
d.Push(20)
e.Push(30)
f.Push(1)
g.Push(5)
h.Pop()
i.Push(8)
j. Push(16)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
