write code in JAVA /* You have to use the following template to submit to Revel. Note: To test the code using the CheckExerciseTool, you will submit entire code. To submit your code to Revel, you must only submit the code enclosed between // BEGIN REVEL SUBMISSION // END REVEL SUBMISSION // BEGIN REVEL SUBMISSION /** Add an element to the beginning of the list */ public void addFirst(E e) { // Write your code here } /** Add an element to the end of the list */ public void addLast(E e) { // Write your code here } /** * Add a new element at the specified index in this list The index of the *head element is 0 */ public void add(int index, E e) { // Write your code here } /** * Remove the head node and return the object that is contained in the * removed node. */ public E removeFirst() { // Write your code here } /** * Remove the last node and return the object that is contained in the * removed node. */ public E removeLast() { // Write your code here } /** * Remove the element at the specified position in this list. Return the * element that was removed from the list. */ public E remove(int index) { // Write your code here } } // END REVEL SUBMISSION
write code in JAVA
/* You have to use the following template to submit to Revel. Note: To test the code using the CheckExerciseTool, you will submit entire code. To submit your code to Revel, you must only submit the code enclosed between // BEGIN REVEL SUBMISSION // END REVEL SUBMISSION
// BEGIN REVEL SUBMISSION
/** Add an element to the beginning of the list */
public void addFirst(E e) {
// Write your code here
}
/** Add an element to the end of the list */
public void addLast(E e) {
// Write your code here
}
/** * Add a new element at the specified index in this list The index of the
*head element is 0
*/
public void add(int index, E e) {
// Write your code here
}
/**
* Remove the head node and return the object that is contained in the
* removed node.
*/
public E removeFirst() {
// Write your code here
}
/**
* Remove the last node and return the object that is contained in the
* removed node.
*/
public E removeLast() {
// Write your code here
}
/**
* Remove the element at the specified position in this list. Return the
* element that was removed from the list.
*/
public E remove(int index) {
// Write your code here
}
}
// END REVEL SUBMISSION
Trending now
This is a popular solution!
Step by step
Solved in 3 steps