Smiths Detection Interview Question

stack using linked list question