Multiple Choice
A queue based on a linked list uses the following code
Class Node{
String element;
Node next;
Node (String el,Node n) {
Element = el;
Next = n;
}
}
Node front = null,rear = null;
What is the right code for String remove() operation? Such an operation removes and returns an element from the queue.
A) if (rear== null)
Throw new RuntimeException("Empty") ;
String temp = rear.element;
Rear = rear.next;
If (front == null)
Rear = null;
Return temp;
B) if (front == rear.
Throw new RuntimeException("Empty".;
String temp = front.element;
Front = front.next;
If (front == null.
Rear = null;
Return temp;
C) if (front == null.
Throw new RuntimeException("Empty".;
String temp = front.element;
Front = front.next;
If (front == null.
Front = rear;
Return temp;
D) if (front == null.
Throw new RuntimeException("Empty".;
String temp = front.element;
Front = front.next;
If (front == null.
Rear = null;
Return temp;
Correct Answer:

Verified
Correct Answer:
Verified
Q1: A stack based on a linked list
Q3: In a list implementation of a queue,the
Q4: The stack pull operation<br>A) increases the capacity
Q5: The stack peek operation<br>A) checks a stack
Q6: Consider a class that uses the following
Q7: A queue is a container that allows
Q8: Consider a class that uses the following
Q9: Consider a class that uses the following
Q10: In an implementation of a stack based
Q11: A queue based on a linked list