The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
consider:
public class MergeSequence
{
Private ArrayList<integer> values;
public MergeSequence() { values = new
ArrayList<integer>(); }
Public void add(int n) Â { Â values.add(n) ; }
Public string tostring() Â { Â return values.tostring() ; Â Â }
}
Â
1) add a method
public MergeSequence append (MergeSequence other)Â
that creates a new sequence, appending in this and the other sequence without modifying either sequence. For example, if sequence (a) is; 1 4 9 16 and b is the sequence 9 7 4 9 11 then call a. append (b) returns the sequence 1 4 9 16 9 7 4 9 11 without modifying a or b
-----------