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

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 22)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!