Reference no: EM132170704
using java
Write the code for a singly-linked list that supports the following: (Please note which examples would be more/less efficient with an array implementation)
a. accessing the element value in the current position.
b. insertion after the current position.
c. moving to the position immediately prior to the current position
d. moving to the position immediately following the current position
4. Which statement inserts a new item x after position current? Illustrate.
a. current = new ListNode(x, current);
b. current = new ListNode(x, current.next);
c. current.next = new ListNode(x, current);
d. current.next = new ListNode(x, current.next);