X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=hints%2Fassignment_4_hint_2.mdwn;fp=hints%2Fassignment_4_hint_2.mdwn;h=5ee63f556482af650f62bd38b42fdb1501400f1a;hp=78cb1bd41f1318724f9168f207868a7eb7914f84;hb=1859a8c4b42139e3a557ec44dd8edd1e1acb71f9;hpb=4c15241dde4586a70e36948d3a9cb035c33c8e5e diff --git a/hints/assignment_4_hint_2.mdwn b/hints/assignment_4_hint_2.mdwn index 78cb1bd4..5ee63f55 100644 --- a/hints/assignment_4_hint_2.mdwn +++ b/hints/assignment_4_hint_2.mdwn @@ -1,4 +1,51 @@ -Hints for list\_equal. +Hints for `list_equal`. + +* If `left` is `[]`, what does `right` have to be for `left` and `right` to be equal? (Come on, it's not too hard, you can figure it out.) + +* Suppose on the other hand that `left` has head `left_hd` and tail `left_tl`. + +
    +
  1. If `right` is then `[]`, are `left` and `right` equal? +
  2. If `right` isn't `[]`, and its head isn't equal to `left_hd`, are `left` and `right` equal? +
  3. If `right` isn't `[]` and its head *is* equal to `left_hd`, what else has to be the case for `left` and `right` to be equal? +
+ +* Can you now write a recursive definition of the `list_equal` function? +What's your base case? + + + +