Question: Assume you have a linked list with a reference named front that points to the first node in the list. What type of operation is
Assume you have a linked list with a reference named front that points to the first node in the list. What type of operation is being performed by the following Java method?
void op(int x) { LinkedNode newNode = new LinkedNode(x); if (front==null) { front = newNode; return; } LinkedNode cur = front; while(cur.next!=null) cur=cur.next; cur.next = newNode; }
| Insertion at the front | ||
| Insertion at the rear | ||
| Deletion from the rear | ||
| Deletion from the front |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
