Home » JAVA Programming » Data Structures » Question
  1. What is the correct method used to insert and delete items from the queue?
    1. add and remove
    2. enqueue and peek
    3. push and pop
    4. enqueue and dequeue
    5. None of these
Correct Option: D

enqueue is pushing item into queue; dequeue is removing item from queue; peek returns object without removing it from queue.
Stack uses push and pop methods. add and remove are used in the list.



Your comments will be displayed only after manual approval.