public Interval pop() { Interval i = head.data; head = head.next; return(i); }
public void push(Interval i) { nodeint itl, itr; itl = this.head; itr = this.head; while ((itr != null) && (itr.data.R > i.R)) { itl = itr; itr = itr.next; } if (head == null) { head = new nodeint(i, null); } else { if (itr == head) { nodeint dd = new nodeint(i, head); head = dd; } else { nodeint d = new nodeint(i, itl.next); itl.next = d; } } }
public PriorityQueue() { head = null; }
public nodeint(Interval data_, nodeint next_) { data = data_; next = next_; }