- give simple adapter that implements our queue adt while using collections deque instance for storage - what values are returned during the following sequence of deque adt operationson initially empty dequeadd first( )add last( )add last( )add first( )back)delete first)delete last)add last( )first)last)add last( )delete first)delete firstr- suppose you have deque containing the numbers ( )in this order suppose further that you have an initially empty queue give code fragment that uses only and (and no other variablesand results in storing the elements in the order ( - repeat the previous problem using the deque and an initially empty stack creativity - suppose alice has picked three distinct integers and placed them into stack in random order write shortstraight-line piece of pseudo-code (with no loops or recursionthat uses only one comparison and only one variable xyet that results in variable storing the largest of alice' three integers with probability / argue why your method is correct - modify the arraystack implementation so that the stack' capacity is limited to maxlen elementswhere maxlen is an optional parameter to the constructor (that defaults to noneif push is called when the stack is at full capacitythrow full exception (defined similarly to emptyc- in the previous exercisewe assume that the underlying list is initially empty redo that exercisethis time preallocating an underlying list with length equal to the stack' maximum capacity - show how to use the transfer functiondescribed in exercise - and two temporary stacksto replace the contents of given stack with those same elementsbut in reversed order - in code fragment we assume that opening tags in html have form as with more generallyhtml allows optional attributes to be expressed as part of an opening tag the general form used is for examplea table can be given border and additional padding by using an opening tag of modify code fragment so that it can properly match tagseven when an opening tag may include one or more such attributes - describe nonrecursive algorithm for enumerating all permutations of the numbers { nusing an explicit stack