This question relies only on creating and manipulating Node objects. The Node class code is shown (partially):
public class Node {
public int data;
public Node next;
}Assume you have appropriate constructors to createNode objects with eitherdefault (0, null) values oruser-assigned values.You may create as many Node objects as you want to solve the following problems, but you cannot create objects of other classes.You do NOT need to create complete methods – only provide as much code as is needed to accomplish each task.3a)Provide code to create a linked sequence of nodes containing the values1, 2, 3, 4, 5.The nodes should be in this order, with the “front” node containing the value 1, and the node farthest away from ““front” containing the value 5.3.b)Describe the form of the linked structure you have created (how many nodes, what order they have, where front and cursor are located, etc.).
}
Assume you have appropriate constructors to createNode objects with eitherdefault (0, null) values oruser-assigned values.
You may create as many Node objects as you want to solve the following problems, but you cannot create objects of other classes.You do NOT need to create complete methods – only provide as much code as is needed to accomplish each task.
3a)
Provide code to create a linked sequence of nodes containing the values1, 2, 3, 4, 5.
The nodes should be in this order, with the “front” node containing the value 1, and the node farthest away from ““front” containing the value 5.
3.b)
Describe the form of the linked structure you have created (how many nodes, what order they have, where front and cursor are located, etc.).
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here