aspose file tools*
The moose likes Java in General and the fly likes finding the top highest element from each of the 3 arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "finding the top highest element from each of the 3 arrays" Watch "finding the top highest element from each of the 3 arrays" New topic
Author

finding the top highest element from each of the 3 arrays

Ambreen Khanam
Greenhorn

Joined: Apr 18, 2013
Posts: 4
Hi..Can you please provide em the optimised sollution for the below problem.

There are 3 sorted arrays say. A[1,3,5,7,9....99] B[2,4,6,8,..100] C[5, 10,15, 20...95]

The output should be 99, 100, 95
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1477
    
    6

As you have said arrays are already sorted, so you already know the last element is the highest number in each array, so you just need to compare the last element of three arrays. Am I wrong?


Swastik
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8008
    
  22

Ambreen Khanam wrote:Hi..Can you please provide em the optimised sollution for the below problem.

Simple answer: No.

We're not in the habit of providing solutions here. What we will do is to help you find you own if you ShowSomeEffort (←click).

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: finding the top highest element from each of the 3 arrays