Sum Of Max And Min You are given an array “ARR” of size N. Your task is to find out the sum of maximum and minimum elements in the array. Follow Up: Can you do the above task in a minimum number of comparisons? Input format: The first line of input contains a single integer T, representing the number of test cases. Th...

read more
CodingNinjas
author
2y
This can be solved by simply traversing the array once and updating the max and min by comparing it with every element. Steps :1. Initialize min and max with the value of the first element of the arra...
see more
CodingNinjas
author
2y
SortingSort the array so that the 0th element will be the minimum value of the array and the last element will be the maximum value present in out array.Space Complexity: O(1)Explanation: O(1) In...
see more
CodingNinjas
author
2y
IteratingSteps: Create two variables maximum and minimum, and initialise with arr[0].Run a loop from i = 1 to N-1 and do:If arr[i] > maximum, then make maximum = arr[i].Else If arr[i] < min...
see more
Add answer anonymously...
SAP Senior Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2023 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter