SHARE
TWEET

Untitled

a guest Nov 12th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public boolean addAll(BstSet<? extends E> c) {
  2.         for (E element : c) {
  3.             add(element);
  4.         }
  5.         return true;
  6.     }
  7.  
  8.     public E higher(E element) {
  9.         E l = root.element;
  10.         BstNode<E> max = getMin(root);
  11.         if(element == max.element)
  12.             return null;
  13.         for (E e : this) {
  14.             if(e.compareTo(element) >0){
  15.                 l = e;
  16.                 break;
  17.             }
  18.         }
  19.         return l;
  20.     }
  21.    
  22.     public E pollLast() {
  23.         E lowest = root.element;
  24.         BstNode<E> max = getMax(root);
  25.         remove(max.element);
  26.         return max.element;
  27.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top