@@ -29,7 +29,7 @@ macid = "TODO"
2929-----------------------------------------------------------------------------------------------------------
3030-- Implement the function split that takes a list and splits it in half and returns a tuple of the
3131-- two halves, WITHOUT USING TAKE / DROP
32- -- NOTE when the list is uneven, the first list is one element larger than the second
32+ -- NOTE when the list is uneven, the second list is one element larger than the first
3333-- NOTE^2 when using take / drop, although convenient, you introduce redundant computation. A more
3434-- efficient implementation of this function can be done calling an auxilary function with
3535-- different parameters that recurses through the list directly
@@ -62,7 +62,7 @@ mergeSort xs = error "TODO implement mergeSort"
6262
6363-- Exercise D
6464-----------------------------------------------------------------------------------------------------------
65- -- Implement the function isSorted that tests if a list is sorted or not
65+ -- Implement the function sortProp that tests if a list is sorted or not
6666-- NOTE you can use this with QuickCheck to test your mergSort function by calling
6767-- quickCheck (sortProp . mergeSort)
6868-----------------------------------------------------------------------------------------------------------
@@ -71,7 +71,8 @@ sortProp xs = error "TODO implement sortProp"
7171
7272-- Exercise E
7373-----------------------------------------------------------------------------------------------------------
74- -- Implement the Prelude function isSorted that tests if a list is sorted or not
74+ -- Implement the Prelude function replicate that takes an Int n and a element and returns a list that
75+ -- replicates that element n times
7576-----------------------------------------------------------------------------------------------------------
7677replicate :: Int -> a -> [a ]
7778replicate n x = error " TODO implement replicate"
0 commit comments