linked list double pointer queue implementation