Question: Hi read the question carefully and answer in java language java language Question 12 12 points Save Answer Write a method called rearrangeQueue to be
Hi read the question carefully and answer in java language java language 
Question 12 12 points Save Answer Write a method called rearrangeQueue to be in a class called QueueApp and has two parameters qi and q2 type ArrayQueue. The qi data is of type Integer and q2 data is of type Character. The method will remove from q1 those elements for which the corresponding elements of q2 are not 'A', 'D' and 'N', and adds the elements removed at the end of q1. It returns the number of elements moved to the end of the queue. Assume q1 and q2 have the same number of elements. Class ArrayQueue and all its methods including iterator are available for use. You can also create temporary queues. You are not allowed to use arrays. Example: Before method call: front 91: 4 92: A 6 9 55 E 2 N 54 B 90 N rear 12 89 D B G S After method call: front q1: 55 6 9 54 89 rear 12 4 2 90 It returns 4. Method heading: public class Queue App { public static int rearrangeQueue (ArrayQueue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
