pike.git / lib / modules / ADT.pmod / Priority_queue.pike

version» Context lines:

pike.git/lib/modules/ADT.pmod/Priority_queue.pike:6:   //! queue is assigned a priority value, and the priority queue always   //! remains sorted in increasing order of the priority values. The top of   //! the priority queue always holds the element with the smallest priority.   //! The priority queue is realized as a (min-)heap.      class elem {    inherit Element;       int|float pri;    -  void create(int|float a, mixed b) { pri=a; ::create(b); } +  protected void create(int|float a, mixed b) { pri=a; ::create(b); }       void set_pri(int|float p)    {    pri=p;    adjust(this);    }       int|float get_pri() { return pri; }    -  int `<(object o) { return pri<o->pri; } -  int `>(object o) { return pri>o->pri; } +  protected int `<(object o) { return pri<o->pri; } +  protected int `>(object o) { return pri>o->pri; }   };      //! Push an element @[val] into the priority queue and assign a priority value   //! @[pri] to it. The priority queue will automatically sort itself so that   //! the element with the smallest priority will be at the top.   elem push(int|float pri, mixed val)   {    elem handle;       handle=elem(pri, val);