MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / Compute

Class Compute

MinMaxArray.java:15–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14
15class Compute
16{
17 static pair getMinMax(long a[], long n)
18 {
19 long maxi = Long.MIN_VALUE;
20 long mini = Long.MAX_VALUE;
21 //Write your code here
22 for(int i=0;i<(int)n;i++)
23 {
24 if(a[i]>maxi)
25 maxi = a[i];
26 if(a[i]<mini)
27 mini = a[i];
28 }
29 return new pair(mini,maxi);
30 }
31}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected