priorityqueue返回前面的javascript

时间:2014-11-28 12:19:21

标签: javascript return priority-queue

如何在javascript中执行方法以返回priorityqueue前面的值而不从队列中删除此值

你能用评论写出来吗,因为我想逐步理解 这是我对priorityqueue的初始代码

function PQueue()
{
 this.pq = new List();          //requirement: linked-list implementation

    // specify (design) methods

    this.isEmpty     = pqEmpty;     //return true if queue empty
    this.deleteMin   = deleteMin;   //remove/return item with minimum priority
    this.insert      = pqinsert;    //insert item with priority
    this.decrease    = decrease;    //updated the priority queue with the new distance value    


}

0 个答案:

没有答案