Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

finding the top highest element from each of the 3 arrays  RSS feed

 
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: 1792
15
Android Eclipse IDE 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
Posts: 10573
65
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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!