posted 12 years ago

Hi

Can any body tell me how i can find out max and min value using the following format

{ArrCol1=1, ArrCol2=2}

{ArrCol1=2, ArrCol2=4}

{ArrCol1=3, ArrCol2=6}

{ArrCol1=4, ArrCol2=8}

{ArrCol1=5, ArrCol2=10}

The above values are Hashmap

So i want to find out ArrCol1 as Min/Max values and ArrCol2 as Min/Max Values

Like

Min of ArrCol1=1

Max of ArrCol1=5

Min of ArrCol2=2

Max of ArrCol2=10

Thanks

Can any body tell me how i can find out max and min value using the following format

{ArrCol1=1, ArrCol2=2}

{ArrCol1=2, ArrCol2=4}

{ArrCol1=3, ArrCol2=6}

{ArrCol1=4, ArrCol2=8}

{ArrCol1=5, ArrCol2=10}

The above values are Hashmap

So i want to find out ArrCol1 as Min/Max values and ArrCol2 as Min/Max Values

Like

Min of ArrCol1=1

Max of ArrCol1=5

Min of ArrCol2=2

Max of ArrCol2=10

Thanks

Graham Thorpe

Ranch Hand

Posts: 265

posted 12 years ago

its not assignment i want to find out min and max for this Col1 ,Col2 individually hashmap result {{Col1=41, Col2=45},{Col1=56, Col2=12},{Col1=10, Col2=11}}

Using Collections.min(collection)

Collections.max(collection)

Minimum of Col1=10

Maximum of Col1=56

and same time Minimum of Col2=11

Maximum of Col2=45

Using Collections.min(collection)

Collections.max(collection)

Minimum of Col1=10

Maximum of Col1=56

and same time Minimum of Col2=11

Maximum of Col2=45

Nigel Browne

Ranch Hand

Posts: 704

Timmy Marks

Ranch Hand

Posts: 226