peekLast
peekLast is a non-destructive operation used on double-ended queues (deques). It returns the element at the back of the deque without removing it, providing a way to inspect the tail while leaving the structure intact. The method is commonly exposed in libraries and languages that implement deques, often alongside a corresponding peekFirst for the front end.
In terms of behavior, peekLast typically returns the last element or a value indicating that the deque
Performance characteristics are usually straightforward: peekLast runs in constant time, O(1), since it only provides a
Common use cases include inspecting the most recently added element, making decisions based on the tail without