js data stuct Posted on 2017-12-18 Edited on 2023-09-02 stackdequeuepriority-queue优先队列 12345678910111213let isAdded = falsefor(let i=0;i<queue.length;i++){ if(element.priority< queue[i].priority){ items.splice(i,0,element) isAdded = true break }}if(!isAdded){ items.push(element)} circular-queue循环队列 1queue.enqueue(queue.dequeue)