implement basic function of stack using linked list