Discussion :: Data Structure MCQs
- Which of the following can be used to delete an element from the rear end of the queue?
A.
public Object deleteRear() throws emptyDEQException {
|
B.
public Object deleteRear() throws emptyDEQException {
|
C.
public Object deleteRear() throws emptyDEQException {
|
D.
None of the mentioned
|
Answer : Option C
Explanation :
Traverse till the end of the list with a pointer 'temp' and another 'cur' which is trailing behind temp, make 'cur' point to trail, this removes all reference for 'temp'.
Be The First To Comment