Question
I am looking for Mk_Shiva32 for help with this problem, as this user was the only one to follow the correct formar in t previous
I am looking for Mk_Shiva32 for help with this problem, as this user was the only one to follow the correct formar in t previous question I had asked.
further below is the actual problem.
*For the entirety of this question you are not allowed to use any data structure * other than a custom built linked list. This should consist ONLY of a node * class that will be given. You should not be creating a secondary class to handle the data * structure. * * Failure to do so will result in no credit.
the node class
public class Node
public Node(E item, Node
public E getItem() { return item; }
public void setItem(E item) { this.item = item; }
public Node
public void setNext(Node
}
the problem: THIS IS WHERE I AM STUCK, PLEASE READ THE PROBLEM.
/** * Problem: Using the Linked List from problem A (PROBLEM A IS BELOW THIS CODE) , print the contents of the Linked List in ascending order, UNLESS the list contains the number 5. If it * contains the number 5, print the list in descending order. DO NOT MAKE ANY OTHER METHODS OR CLASSES AND DO NOT CHANGE ANY OF THE METHOD HEADERS OR CLASSES
public Node
PROBLEM A:
public Node
Node
if(userInput.hasNextInt()) { int numInput = userInput.nextInt(); if (start == null) { start = new Node<>(numInput, null); tail = start; } else { Node
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started