In an ancient land, the beautiful princess Eve had many suitors She decided on the following procedure to determine which suitor she would marry First, all of the suitors would be lined up on after the other and assigned numbers The first suitor would be number 1, the second number 2, and so on up to the last suitor, number n starting at the first suitor she would then count three suitors down the line (because of the three letters in her name) and the third suitor would be eliminated from winning her hand and removed from the line Eve would then continue, counting three more suitors, and eliminating every third suitor When she reached the end of the line she would continue counting from the beginning. For example, if there were six suitors then the elimination process would proceed as follows: Write a program that creates a circular linked list of nodes to determine which position you should stand in to marry the princess if there are n suitors Your program should simulate the elimination process by deleting the node that corresponds to the suitor that is eliminated for each step in the process. Solution import java.util.Scanner; import java.util.Stack; public class CircularLinkedListImpl { private Node node = null; private Node head = null; private Node tail = null; private static int listCount = 0; public CircularLinkedListImpl() { } /* Function to delete element at position */ public void deleteAtPos(int pos) { if (this.listCount == 1 && pos == 1) { head = null; tail = null; this.listCount = 0; return; } if (pos == 1) { head = this.head.next; tail.next = head; listCount--; return; } if (pos == listCount) { Node s = head; Node t = head; while (s != tail) { t = s; s = s.next; } tail = t; tail.next = head; listCount--; return; } Stack> stack = new Stack>(); Node ptr = head.next; pos = pos - 1; for (int i = 1; i < listCount - 1; i++) { if (i == pos) { System.out.println(\"kfdsf\" + ptr.item); Node tmp = ptr.next; tmp = tmp.next; ptr.next = tmp; break; } stack.push(ptr); } listCount--; } public boolean add(E element) { boolean isItemAdded = false; Node tempNode = new Node(element); Node node = this.node; if (node == null) { this.node = tempNode; this.head = this.node; this.tail = this.node; CircularLinkedListImpl.listCount++; isItemAdded = true; } else { while (node.next != null) { System.out.println(node.next.item); node = node.next; } tempNode.next = node.next; node.next = tempNode; this.tail = tempNode; CircularLinkedListImpl.listCount++; isItemAdded = true; } return isItemAdded; } public int size() { return CircularLinkedListImpl.listCount++; } public String toString() { String output = \"\"; if (this.node != null) { Node crunchifyCurrent = this.node; while (crunchifyCurrent != null) { output += \"[\" + crunchifyCurrent.item.toString() + \"]\"; crunchifyCurrent = crunchifyCurrent.next; } } return output; } public static void main(String[] args) { CircularLinkedListImpl c = new CircularLinkedListImpl(); Scanner scan = new Scanner(System.in).