Exemple #1
0
        public T pop()
        {
            T ret = top.val;

            top = HeapNode <T> .meld(top.r, top.l);

            return(ret);
        }
Exemple #2
0
 public void merge(Heap <T> h2)
 {
     top = HeapNode <T> .meld(top, h2.top);
 }
Exemple #3
0
 public void push(T val)
 {
     top = HeapNode <T> .meld(top, new HeapNode <T>(val));
 }
Exemple #4
0
 public void merge(SkewHeap <T> otherHeap)
 {
     this.count_ += otherHeap.Count;
     this.topNode = HeapNode.meld(this.topNode, otherHeap.topNode);
 }
Exemple #5
0
 public void push(T val)
 {
     this.topNode = HeapNode.meld(this.topNode, new HeapNode(val));
     this.count_++;
 }
Exemple #6
0
 public void pop()
 {
     this.topNode = HeapNode.meld(this.topNode.l, this.topNode.r);
     this.count_--;
 }