File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

finding the top highest element from each of the 3 arrays

 
Ambreen Khanam
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1601
5
Android Java Java ME
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Winston Gutkowski
Bartender
Pie
Posts: 9490
50
Eclipse IDE Hibernate Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic