Advertisement
Guest User

Untitled

a guest
May 1st, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1.     public myPortion[] fusion(myPortion last, myPortion inserted){
  2.         myPortion[] result;
  3.         if(last.getEnd()<inserted.getBegin()){
  4.             result= new myPortion[2];
  5.             result[0]=last;
  6.             result[1]=inserted;
  7.         }
  8.         else {
  9.             myPortion fus = new myPortion(last.getBegin(), Math.max(last.getEnd(), inserted.getEnd()));
  10.             result = new myPortion[1];
  11.             result[0] = fus;
  12.         }
  13.         return result;
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement