Question DSA-STK-0023
EasyWhich operation returns the top element of a stack without removing it?
- A.
peek (or top)
- B.
push
- C.
pop
- D.
dequeue
Show answer and explanation
Answer: A
peek lets you look before deciding whether to pop.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Stacks question
Which operation returns the top element of a stack without removing it?
peek (or top)
push
pop
dequeue
Answer: A
peek lets you look before deciding whether to pop.