Question: In the following code fragment the else body has a local variable, tempNode, how do you design that clause not to use tempNOde? (point
In the following code fragment the else body has a local variable, tempNode, how do you design that clause not to use tempNOde? (point 5) public void addFirst(E e) { if (size == 0) {tail = new Node (e, null); tail.setNext(tail) } else { Node tempNode = new Node (e, tail.getNext()); tail.setNext(TempNode); } size++; }
Step by Step Solution
3.31 Rating (145 Votes )
There are 3 Steps involved in it
To design the else clause without using the local variable tempNode you can directly manip... View full answer
Get step-by-step solutions from verified subject matter experts
