generic queue implemented using a linked list