sunny gupta
BAN USER
Questions (3)
Comments (4)
Reputation 60
- 0of 0 votes
Answersswap Two Number by using ternary operator
- sunny gupta in India| Report Duplicate | Flag | PURGE
National Informatics Centre Software Analyst - 0of 0 votes
Answersthere are three shorted int Array
- sunny gupta in India
A1 : {2,4,9,16,19,68,78}
A2:{4,8,67,106,109,115,120}
A3:{9,15,19,108,119,130,190}
write an efficient algo to get the top 5 largest number from these three arrays.
Function would be like
int[] top5LargestNumber(int[] A1,int[] A2,int[] A3)| Report Duplicate | Flag | PURGE
Software Engineer / Developer Algorithm
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
@Vgeek
But there is a possibility to get the all 5 largest number in one array or two array also. picking up two elements from each array wont work here.
Comment hidden because of low score. Click to expand.
0
of 0 vote
@Vgeek
Please provide . that would be great help .
Thanks in advance.
Comment hidden because of low score. Click to expand.
0
of 0 vote
@Apostle .. Let suppose arrays are not in sorted form. then what approach should we follow .
- sunny gupta July 26, 2013Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
@Vgeek
- sunny gupta July 26, 2013Making one more array is not seems efficient because if all three arrays size are more . then after merging 4th array would be too large and occupy too much memory also.
Not have much idea but same logic i have used in Interview and they rejected by the same reason.