mirror of
https://github.com/iritmaximus/haskell.git
synced 2026-10-12 19:13:39 +03:00
set3b merge
This commit is contained in:
+6
-1
@@ -142,7 +142,12 @@ sumsOf xs = todo
|
||||
-- merge [1,1,6] [1,2] ==> [1,1,1,2,6]
|
||||
|
||||
merge :: [Int] -> [Int] -> [Int]
|
||||
merge xs ys = todo
|
||||
merge (x:xs) (y:ys) = if x < y
|
||||
then x : merge xs (y:ys)
|
||||
else y : merge (x:xs) ys
|
||||
merge [] (y:ys) = y : merge [] ys
|
||||
merge (x:xs) [] = x : merge xs []
|
||||
merge [] [] = []
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- Ex 8: compute the biggest element, using a comparison function
|
||||
|
||||
Reference in New Issue
Block a user