Lecture Notes on 21 Oct 2022 * Evaluate the following Reverse Polish expressions: 4 8 7 + 2 * 3 1 - * + 3 4 + 5 * 3 4 5 + * 7 4 + 3 - 2 5 * / class Stack (object): def __init__ (self): self.stack = [] # add an item to the top of the stack def push (self, item): self.stack.append (item) # remove an item from the top of the stack def pop (self): return self.stack.pop() # check the item on the top of the stack def peek (self): return self.stack[-1] # check if stack is empty def is_empty (self): return (len(self.stack) == 0) # return the number of elements in the stack def size (self): return (len (self.stack)) class Queue (object): def __init__ (self): self.queue = [] # add an item to the end of the queue def enqueue (self, item): self.queue.append (item) # remove an item from the beginning of the queue def dequeue (self): return self.queue.pop(0) # check if the queue is empty def is_empty (self): return (len (self.queue) == 0) # return the number of elements in the queue def size (self): return (len (self.queue()))