- given classpriorityqueuethat implements the minimum-oriented priority queue adtprovide an implementation of maxpriorityqueue class that adapts to provide maximum-oriented abstraction with methods addmaxand remove max your implementation should not make any assumption about the internal workings of the original priorityqueue classnor the type of keys that might be used - write key function for nonnegative integers that determines order based on the number of ' in each integer' binary expansion - give an alternative implementation of the pq sort functionfrom code fragment that accepts key function as an optional parameter - describe an in-place version of the selection-sort algorithm for an array that uses only ( space for instance variables in addition to the array - assuming the input to the sorting problem is given in an array adescribe how to implement the insertion-sort algorithm using only the array and at most constant number of additional variables - give an alternate description of the in-place heap-sort algorithm using the standard minimum-oriented priority queue (instead of maximumoriented onec- an online computer system for trading stocks needs to process orders of the form "buy shares at $ eachor "sell shares at $ each buy order for $ can only be processed if there is an existing sell order with price $ such that < likewisea sell order for $ can only be processed if there is an existing buy order with price $ such that < if buy or sell order is entered but cannot be processedit must wait for future order that allows it to be processed describe scheme that allows buy and sell orders to be entered in (log ntimeindependent of whether or not they can be immediately processed - extend solution to the previous problem so that users are allowed to update the prices for their buy or sell orders that have yet to be processed - group of children want to play gamecalled unmonopolywhere in each turn the player with the most money must give half of his/her money to the player with the least amount of money what data structure(sshould be used to play this game efficientlywhyprojects - implement the in-place heap-sort algorithm experimentally compare its running time with that of the standard heap-sort that is not in-place - use the approach of either exercise - or - to reimplement the top method of the favoriteslistmtf class from section make sure that results are generated from largest to smallest