Question: Please help, this is for programming with the java language 2, Consider the following linked list that is poin ted to by a pointer Head
2, Consider the following linked list that is poin ted to by a pointer Head of type Node. Head a) What is the value of each of the following? If an undefined value is printed, indicate so with a U. If the expression crashes at run time, indicate so with a RT Error. (2 points each) i. Head.getNext .getNext) ii. Head.getNext .getItemOE ii. Head.getNext (.gotNext O.getitem) iv. Head.getNext .getNext ).getNext ) v. Head.getNext ).getNext ) Head vi. Head.getNext().getNext().getNext ().get Item() (b) Write the line(s) of code that would be needed to add the character 'A' to the front of this list. Be sure you link your new node properly to the existing list, and reset your Head. (4 points) (c) Suppose your list is as it is originally drawn above, and you decide to delete the char- acter 'E' (the second item). Write the line(s) of code to perform this task and re-link your list properly. (4 points) (d) Write the line(s) of code needed to turn the original list into a circular linked list. (2 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
