1.

What is the functionality of the following piece of code? public void function(Object item) { Node temp=new Node(item,trail); if(isEmpty()) { head.setNext(temp); temp.setNext(trail); } else { Node cur=head.getNext(); while(cur.getNext()!=trail) { cur=cur.getNext(); } cur.setNext(temp); } size++; }

A. Insert at the front end of the dequeue
B. Insert at the rear end of the dequeue
C. Fetch the element at the rear end of the dequeue
D. Fetch the element at the front end of the dequeue
Answer» C. Fetch the element at the rear end of the dequeue


Discussion

No Comment Found