1. Write a Python function that uses a Stack to reverse a list. You can assume that the Stack class exists with all of the standard Stack operations: Stack, push, pop, peek, len, isEmpty. def revWithStack (lst): stack = Stack() for x in lst: stack.push(x) newlst = [] while not stack.isEmpty(): newlst.append( stack.pop() ) return newlst >>> from Stack import * >>> a = [1, 2, 3, 4] >>> revWithStack(a) [4, 3, 2, 1] ---------------------------------------------------------------------- 2. Below are some constructors, accessors and mutators for a Node class and an UnorderedList class. Write a method in the class to get the values from the UnorderedList (i.e., self) and create a regular Python list from the values. You should not destroy the original UnorderedList. class Node: def __init__(self, initdata): self._data = initdata self._next = None def getData(self): ... def getNext(self): ... def setData(self, newdata): ... def setNext(self, newnext): ... class UnorderedList: def __init__(self): self._head = None def toList(self): output = [] ptr = self._head while ptr != None: output.append( ptr.getData() ) ptr = ptr.getNext() return output >>> from Lists import * >>> ul = UnorderedList() >>> ul.addToFront(4) >>> ul.addToFront('abc') >>> ul.addToFront(17) >>> ul.toList() [17, 'abc', 4] ---------------------------------------------------------------------- 3. Suppose you have the UnorderedList class with the standard operators: List, addToFront, get, remove, search, isEmpty, len. Show how you could use your UnorderedList class to implement the following Stack methods. If there are other UnorderedList} methods that you need, show how you'd implement them. class StackWithLists: def __init__(self): def push(self, item): def pop(self): In UnorderedList class: def removeFromFront(self): if not self.isEmpty(): temp = self._head self._head = self._head.getNext() return temp.getData() else: return None In StackWithLists class: def __init__(self): self._items = UnorderedList() def push(self, item): self._items.addToFront(item) def pop(self): return self._items.removeFromFront() >>> from Lists import * >>> swl = StackWithLists() >>> swl.push(3) >>> swl.push(1) >>> swl.push(2) >>> swl.pop() 2 >>> swl.pop() 1 >>> swl.pop() 3 >>> swl.pop()