Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- minMaxAvgTR :: (Ord a, Fractional a) => [a] -> (a,a,a)
- minMaxAvgTR (x:xs) = maxTRh xs x 0 0 0
- where
- maxTRh [] min max sum listLength = (min, max, (sum / (fromIntegral listLength)))
- maxTRh (x:xs) min max sum listLength | x < min = maxTRh xs x max (x + sum) (1 + listLength)
- | x > max = maxTRh xs min x (x + sum) (1 + listLength)
- | otherwise = maxTRh xs min max (x + sum) (1 + listLength)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement