Question: Write a method called countGrater to be included in the class ArrayQueue that accepts a parameter q2 of type ArrayQueue. The method compares the corresponding
Write a method called countGrater to be included in the class ArrayQueue that accepts a parameter q2 of type ArrayQueue. The method compares the corresponding elements of q2 and "this queue and counts those elements which are grater. You are not allowed to use any of the methods of ArrayQueue class or arrays. Assume q2 and "this" queue are of the same size. Do not call any method of class ArrayQueue. Example: "this" queue: 10 5 2 7 12 15 20 92: 10 9 2 7 11 10 20 The method will return 2 as 2 elements of this" queue grater with corresponding elements of q2. Method heading: public int countGrater(ArrayQueue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
