Challenging question! (Does anyone how to solve this Javabat question?)

Does anyone how to solve this Javabat question?
Here is the link:
http://www.javabat.com/prob?id=Array3.linearIn

I'm a little surprised by the implied rating of this problem... it's a plain to-way merge. You can use the same template as for the merging step in merge sort:
public boolean linearIn(int[] outer, int[] inner) {
  int i = 0;
  int j = 0;
  while (i < outer.length || j < inner.length) {
      if (j < inner.length && (i == outer.length || inner[j] < outer)) {
// inner[j] smallest
return false;
else if (i < outer.length && (j == inner.length || outer[i] < inner[j])) {
// outer[i] smallest
i++;
else {
// inner[j] == outer[i]
i++; j++;
return true;

Similar Messages

Maybe you are looking for

  • Soon-to-be Macbook Pro convert asks questions

    Hi there! I have had Windows PCs in the past and i want some change. i want to do things more quicker & simplier. I have been researching for the past week or so a comparison on Apple Macs and the latest crop of Windows 7 laptops and i wanted to ask

  • Is there a way to customize Automatic Import?

    I really like this feature, but is usually reaches a certain cut in the mini DV it doesn't like, and stops/rewinds. I get back to my iMac with a "38 minutes of video were imported" message for a 60 minute tape. Is there a way to tweak the 'automatic'

  • Idvd4 is in applications folder, but not recognized

    after numerous problems with iDVD freezing and shutting down, I tried installing the latest software update (4.0.1 updater) and much to my surprise it says idvd 4 was not found in /applications. can anyone solve my conundrum? (i've run cache out x, m

  • Photoshop CS5 problem- won't open

    None of my adobe products will open with the exception of Lightroom- please help

  • Delete Mode

    Hi, I would like to delete a single mode of any user/terminal (depending on the used tcode) after 5 min inactivity. My coding works so far, but it closes the parent mode (where I run my abap-program), not the mode I what it to close (where the tcode