35.4k views
1 vote
_____ means retrieve the element at the top of a stackwithout removing it.

a. Peek
b. Top
c. Push
d. Pop
e. none of the above

User JKSH
by
3.7k points

1 Answer

5 votes

Answer:

A - Peek

Step-by-step explanation:

The peek method retrieves the element at the top of a stack without deleting/removing it, the only exception that can occur is when the stack used is empty. It would look as follows when you use the method >> STACK.peek().

User CJ Zougloub
by
5.0k points