Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- maximum' [] = error "maximum of empty list"
- maximum' [x] = x
- maximum' (x:xs)
- | x > current = x
- | otherwise = current
- where current = maximum' xs
- minimum' [] = error "minimum of empty list"
- minimum' [x] = x
- minimum' (x:xs)
- | x < current = x
- | otherwise = current
- where current = minimum' xs
- {-
- Liste -> Tupel mit min max raus
- -}
- seekMaxMin' [] = (0,0)
- seekMaxMin' [x] = (x,x)
- seekMaxMin' (x:xs) = (minimum' xs, maximum' xs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement