Answer:
Step-by-step explanation:
The following code is written in Java. It creates a Queue/Linked List that holds the names of each of the individuals in the question. Then it returns John and removes him and finally returns Paula and removes her.
package sample;
import java.util.*;
class GFG {
public static void main(String args[])
{
Queue<String> pq = new LinkedList<>();
pq.add("John");
pq.add("Paula");
pq.add("George");
pq.add("Judy");
System.out.println(pq.peek());
pq.remove("John");
System.out.println(pq.peek());
pq.remove("Paula");
}
}