- alice has two queuesq and rwhich can store integers bob gives alice odd integers and even integers and insists that she store all integers in and they then play game where bob picks or at random and then applies the round-robin schedulerdescribed in the to the chosen queue random number of times if the last number to be processed at the end of this game was oddbob wins otherwisealice wins how can alice allocate integers to queues to optimize her chances of winningwhat is her chance of winningc- suppose bob has four cows that he wants to take across bridgebut only one yokewhich can hold up to two cowsside by sidetied to the yoke the yoke is too heavy for him to carry across the bridgebut he can tie (and untiecows to it in no time at all of his four cowsmazie can cross the bridge in minutesdaisy can cross it in minutescrazy can cross it in minutesand lazy can cross it in minutes of coursewhen two cows are tied to the yokethey must go at the speed of the slower cow describe how bob can get all his cows across the bridge in minutes projects - give complete arraydeque implementation of the double-ended queue adt as sketched in section - give an array-based implementation of double-ended queue supporting all of the public behaviors shown in table for the collections deque classincluding use of the maxlen optional parameter when lengthlimited deque is fullprovide semantics similar to the collections deque classwhereby call to insert an element on one end of deque causes an element to be lost from the opposite side - implement program that can input an expression in postfix notation (see exercise - and output its value - the introduction of section notes that stacks are often used to provide "undosupport in applications like web browser or text editor while support for undo can be implemented with an unbounded stackmany applications provide only limited support for such an undo historywith fixed-capacity stack when push is invoked with the stack at full capacityrather than throwing full exception (as described in exercise - ) more typical semantic is to accept the pushed element at the top while "leakingthe oldest element from the bottom of the stack to make room give an implementation of such leakystack abstractionusing circular array with appropriate storage capacity this class should have public interface similar to the bounded-capacity stack in exercise - but with the desired leaky semantics when full