SHARE
TWEET

Untitled

a guest Feb 27th, 2020 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public MengdeADT<T> union(MengdeADT<T> m2) {
  2.         MengdeADT<T> begge = new KjedetMengde<T>();
  3.         LinearNode<T> aktuell = start;
  4.         T element = null;
  5.         boolean ferdig = false;
  6.         if (this.equals(m2)) {
  7.             Iterator<T> teller = this.oppramser();
  8.             while(teller.hasNext()) {
  9.                 element = teller.next();
  10.                 begge.leggTil(element);
  11.             }
  12.             ferdig = true;
  13.         } else {
  14.             begge = this;
  15.             Iterator<T> teller = m2.oppramser();
  16.             while (teller.hasNext() && !ferdig) {
  17.                 element = teller.next();
  18.                 if ((!begge.inneholder(element))) {
  19.                     begge.leggTil(element);
  20.                 }
  21.             }
  22.         }
  23.  
  24.         return begge;
  25.     }
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
Top