Stack using linked list and some other algorithms on stacks