/// <summary> /// sets the object priority to c /// </summary> internal void set_priority(int o,int oldPriority,int newPriority) { PQMember pqm=new PQMember(o,oldPriority); RBNode node=tree.delete(pqm); if(node==tree.NIL) { throw new InvalidOperationException("in set_priority"); } pqm.priority=newPriority; tree.insertIfUniq(pqm); }
/// <summary> /// sets the object priority to c /// </summary> internal void set_priority(int o, int oldPriority, int newPriority) { PQMember pqm = new PQMember(o, oldPriority); RBNode node = tree.delete(pqm); if (node == tree.NIL) { throw new InvalidOperationException("in set_priority"); } pqm.priority = newPriority; tree.insertIfUniq(pqm); }
public int CompareTo(object obj) { PQMember qm = obj as PQMember; if (qm == null) { throw new ArgumentException("obj must be of type 'PQMember'"); } int v = priority - qm.priority; if (v != 0) { return(v); } return(this.o - qm.o); }
internal void insert(int o, int priority) { PQMember pqm=new PQMember(o,priority); tree.insertIfUniq(pqm); }
internal void insert(int o, int priority) { PQMember pqm = new PQMember(o, priority); tree.insertIfUniq(pqm); }