creativity - show how to implement the stack adt using only priority queue and one additional integer instance variable - show how to implement the fifo queue adt using only priority queue and one additional integer instance variable - professor idle suggests the following solution to the previous problem whenever an item is inserted into the queueit is assigned key that is equal to the current size of the queue does such strategy result in fifo semanticsprove that it is so or provide counterexample - reimplement the sortedpriorityqueue using python list make sure to maintain remove min' ( performance - give nonrecursive implementation of the upheap method for the class heappriorityqueue - give nonrecursive implementation of the downheap method for the class heappriorityqueue - assume that we are using linked representation of complete binary tree and an extra reference to the last node of that tree show how to update the reference to the last node after operations add or remove min in (log ntimewhere is the current number of nodes of be sure and handle all possible casesas illustrated in figure - when using linked-tree representation for heapan alternative method for finding the last node during an insertion in heap is to storein the last node and each leaf node of reference to the leaf node immediately to its right (wrapping to the first node in the next lower level for the rightmost leaf nodeshow how to maintain such references in ( time per operation of the priority queue adt assuming that is implemented with linked structure ( , ( , ( , ( , ( , ( , ( , ( , ( , ( , ( ,fw ( , ( , ( , ( , ( , ( , ( , ( , ( , ( ,qw ( , ( , ( , ( ,bz ( ,hz ( (bfigure updating the last node in complete binary tree after operation add or remove node is the last node before operation add or after operation remove node is the last node after operation add or before operation remove