AkronCodeClub / edX-FP101x-Oct-2014

Study group for edX course FP101x beginning October 2014
8 stars 1 forks source link

HW01 `qsort` #11

Open jdantonio opened 9 years ago

jdantonio commented 9 years ago

The first homework assignment (due Oct. 29, 2014) uses the qsort function described in the video lectures. It does not actually show the function, however. I had to go back to the videos to find it. For reference, here it is:

qsort [] = []
qsort (x : xs) = qsort smaller ++ [x] ++ qsort larger
                 where
                   smaller = [a | a <- xs, a <= x]
                   larger = [b | b <- xs, b > x]

PS: I haven't done the labs yet so it may also be in the labs. PPS: I got a 100% on the quiz. Ping me if you have any questions about any of the exercises on the quiz.

ghost commented 9 years ago

I didn't quite get 100%: One of the qsort solutions using reverse fooled me. I liked that even the first homework was fairly challenging, though, especially for those of us new to Haskell.

jdantonio commented 9 years ago

@vht-sorourke I liked it, too. It definitely made me think. I also spent a good amount of time in ghci running the code making sure I understood what it was doing. REPL FTW!

alanphil commented 9 years ago

Thanks for the 'heads up' on the qsort question. I worked through each example in ghci to get one point for problem 7. Then I moved too quickly on problem 8, not realizing until it was too late that it is a tricky word problem! 88% for my first homework assignment.