Implement a Stack using a Linked List
EasyImplement a stack using a singly Linked List.
Your
Stack class should implement the following methods:push- adds data to the stackpop- Pops the last data out of the stackpeek- Returns the data at the top of the stack (keeps that data in the stack)
Try it first
Solution
6 Essential Stacks & Queues Coding Interview Problems
Master Stacks & Queues by trying the coding challenges below.
- 1.Implement StackEasy
- 2.Implement QueueEasy
- 3.Valid stack sequenceMedium
- 4.Max StackMedium
- 5.Valid ParenthesesMedium
- 6.Simplify PathMedium
