Implement Singly Linked List detectLoop which check whether the linked list contains a It’s an instance method that takes no parameter. It returns true if the linked list contains a loop
INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS
Implement Singly Linked List detectLoop which check whether the linked list contains a
It’s an instance method that takes no parameter. It returns true if the linked list contains a loop that goes on forever if tracing the list from head. It returns false if it does not contain a loop.
Implement Doubly Linked List add method which add an element to a specific
It’s an instance method that takes a position and an element, then adds the element to this specific position and shifts the element currently at this position and any subsequent elements to the right. It throws an exception if the position is out of bound. It traverses the list from header if the position is closer to the header and traverses the list from trailer otherwise.
Implement Polynomial Linked List add method which adds two polynomials in standard form and returns sum polynomial which also has to be in standard
Rewrite the instance method that takes a second Polynomial Linked List, and then adds all terms in the caller Polynomial and all terms in the second Polynomial Linked List together into another sum Polynomial. Both caller and parameter Polynomials are expected to be in standard form, the method should return the sum Polynomial also in standard form. A standard form polynomial has no duplicate terms (each term’s exponent is unique) and the exponent is in descending