This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design 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
  • 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: 1603
5
Android Java Java ME
  • 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: 10226
58
Eclipse IDE Hibernate Ubuntu
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic