Exercise 10.2.2
Implement a stack using a singly linked list
L
. The operationsPUSH
andPOP
should still take $\O(1)$ time.
This is too simple to be worth implementing.
The PUSH
operation adds an element in the beginning of the list and the
POP
operation removes the first element from the list.