write a method that takes two array of customer and what they need and compare them to see if if the what customer wants is present in the front or else send the customer to back. Use queue data structure. Use the following code to complete. import java.util.LinkedList; import java.util.Queue; public class MyQueue{ public int Customer(String[] cust, String[] object) { Queue queue = new LinkedList<>(); // write your logic here } example:- cust[] = { P, P, O, O } object[] = { O, P, P, O} since customer P doesn,t want O send it back. loop this to find out how many customers will end up having no object. }
write a method that takes two array of customer and what they need and compare them to see if if the what customer wants is present in the front or else send the customer to back. Use queue data structure.
Use the following code to complete.
import java.util.LinkedList;
import java.util.Queue;
public class MyQueue{
public int Customer(String[] cust, String[] object) {
Queue<String> queue = new LinkedList<>();
// write your logic here
}
example:-
cust[] = { P, P, O, O }
object[] = { O, P, P, O}
since customer P doesn,t want O send it back. loop this to find out how many customers will end up having no object.
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Is it possible to not use peek()? Please help me with method that doesn't have peek()