A

Admin • 802.91K Points
Coach

Q. What does `peek()` do in a Deque context?

  • (A) Removes the head element
  • (B) Returns head element without removing it
  • (C) Throws exception if deque is empty
  • (D) Returns the last element

Explanation by: Admin
`peek()` retrieves but does not remove the head of the deque.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.