Vidyalelo
Data Structure · Q91

Introduction to Data Structures

Programming · Data Structure · question 91

Q91

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
Answer
C.
Fetch the element at the rear end of the dequeue
D.
Fetch the element at the front end of the dequeue

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board