Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public myPortion[] fusion(myPortion last, myPortion inserted){
- myPortion[] result;
- if(last.getEnd()<inserted.getBegin()){
- result= new myPortion[2];
- result[0]=last;
- result[1]=inserted;
- }
- else {
- myPortion fus = new myPortion(last.getBegin(), Math.max(last.getEnd(), inserted.getEnd()));
- result = new myPortion[1];
- result[0] = fus;
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement