importLinkedListfrom'../linked-list/LinkedList.js';exportdefaultclassQueue{constructor(){this.linkedList=newLinkedList();}/** * @return {boolean} */isEmpty(){return!!this.linkedList.head;}/** * Read the element at the front of the queue without removing it. * @return {*} */peek(){if(!this.linkedList.head){returnnull;}returnthis.linkedList.head.value;}/** * Add a new element to the end of the queue (the tail of the linked list). * This element will be processed after all elements ahead of it. * @param {*} value */enqueue(value){returnthis.linkedList.append(value);}/** * Remove the element at the front of the queue (the head of the linked list). * If the queue is empty, return null. * @return {*} */dequeue(){constdeletedNode=this.linkedList.deleteHead();returndeletedNode?deletedNode.value:null;}/** * @param [callback] * @return {string} */toString(callback){returnthis.linkedList.toString(callback);}}