Computer Science Please complete the following methods and areas commented out in java. Also provide a screen shot so i know its working. Thank you. ---------------------------------------------------------------- public class TheLinkedList { private class Node { public Type item; public Node next; ///create constructor for the node class public String toString() { return element.toString(); } } private Node first; private Node current; private Node previous; private int size; public void insertBefore(Type element) { //Inserts element before the current Node. If the curr is null then element is put in last position } public void insertAfter(Type element) { //Inserts element after current Node and if current is Null then it doesnt do anything } public Type current() { //return the current node } public Type first() { //set the current node to the first and return it } public Type next() { //set the current Node to the next node and return it }
Computer Science
Please complete the following methods and areas commented out in java. Also provide a screen shot so i know its working. Thank you.
----------------------------------------------------------------
public class TheLinkedList<Type> {
private class Node {
public Type item;
public Node next;
///create constructor for the node class
public String toString() {
return element.toString();
}
}
private Node first;
private Node current;
private Node previous;
private int size;
public void insertBefore(Type element) {
//Inserts element before the current Node. If the curr is null then element is put in last position
}
public void insertAfter(Type element) {
//Inserts element after current Node and if current is Null then it doesnt do anything
}
public Type current() {
//return the current node
}
public Type first() {
//set the current node to the first and return it
}
public Type next() {
//set the current Node to the next node and return it
}
Step by step
Solved in 5 steps