It works with different implementations of stacks and queues using linked lists.