Question: Circular (Singly) linked lists are linked lists in which the tail is connected back to the head, and there is only one reference to
Circular (Singly) linked lists are linked lists in which the tail is connected back to the head, and there is only one reference to the list, i.e. the node "current" which is a reference to the "current" beginning of the list. The following figure shows this structure: current 6 5 8 10 Exercises for the Quiz: 1) [Warmup] Download, compile and execute the classes CLLNode.java, CLL.java and CircularLinked ListApplication.java 2) [1.5% marks] Write a method public int lengthOfTheList () method in the class CLL.java that computes and returns the length of a given circular list. A call to this test method is already given in the test class CircularLinkedListApplication.java 3) [2.5% marks] Write a method public T deleteFromBeginning ( )]method in the class CLL.java that deletes an element from the beginning of the circular linked list (i.e. the element at current). A call to this method is already given in the test class CircularLinked List Application.java +++++++CLLNode.java+++++ ++ ++++++++++ public class CLLNode { public T info; public CLLNode next; public CLLNode() { this (null, null);B } public CLLNode(T el) { } this(el, null); public CLLNode(T el, CLLNode ptr) { info el; next = ptr; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
