Max/Min values in an associative array
Justin Whear via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Aug 6 11:04:00 PDT 2014
On Wed, 06 Aug 2014 17:57:54 +0000, TJB wrote:
> I am trying to find the max and min values in an associative array. Say
> I have:
>
> double[char] bids;
> bid['A'] = 37.50;
> bid['B'] = 38.11;
> bid['C'] = 36.12;
>
> How can I find the max and min values. I am thinking that I need to use
> max and min functions from std.algorithm, but not sure how to.
>
> Thanks!
> TJB
Do you just need the min and max values or do you also need the keys of
those values? If the former, here's a paste:
http://dpaste.dzfl.pl/0bbf31278a25
More information about the Digitalmars-d-learn
mailing list