Question DSA-STK-0023
EasyWhich operation returns the top element of a stack without removing it?
- A.
peek (or top)
- B.
push
- C.
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
Answer: A
peek lets you look before deciding whether to pop.
pop
dequeue