☑Kizspy.me
(Choose 1 answer)
☐ A
Back
Next
Specify the correct implementation of dequeue() method of a queue. This queue uses java.util.ArrayList for
storing data and the head of the list is treated as the head of the queue. (Choose the most suitable one)
A. Object dequeue()
{if (isEmpty()) return(null);
}
return(pool.remove(pool.size()));
B. void dequeue(Object x)
{ if (isEmpty()) return(null);
pool.remove(pool.size()-1);
C. Object dequeue()
{if (isEmpty()) return;
}
return(pool.remove(pool.size()-1));
D. Object dequeue()
{if (isEmpty()) return(null);
}
return(pool.remove(0));
FUO.sh
sh the exam.