X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment5.mdwn;h=f0ee48119f8f71be65377a1df8211aa6aec92013;hp=00ede5aaf1ef0ff93018070b18ef3ddc606ba69f;hb=156112d5318daed7c47e18e982a6f8a12b498fd7;hpb=6922b3d0f2e4fc3a60bc2a388bac5586156beb9f diff --git a/exercises/assignment5.mdwn b/exercises/assignment5.mdwn index 00ede5aa..f0ee4811 100644 --- a/exercises/assignment5.mdwn +++ b/exercises/assignment5.mdwn @@ -116,7 +116,7 @@ Choose one of these languages and write the following functions. 6. How would you use the function defined in problem 4 to enumerate a tree's fringe? (Don't worry about whether it comes out left-to-right or right-to-left.) -7. Write a recursive function to make a copy of a `color_tree` with the same structure and inner branch colors, but where the leftmost leaf is now labeled `0`, the second-leftmost leaf is now labeled `1`, and so on. (Here's a [[hint|assignment5 hint3]], if you need one.) +7. Write a recursive function to make a copy of a `color_tree` with the same structure and inner branch colors, but where the leftmost leaf is now labeled `0`, the second-leftmost leaf is now labeled `1`, and so on. (Here's a [[hint|assignment5 hint4]], if you need one.) 8. (More challenging.) Write a recursive function that makes a copy of a `color_tree` with the same structure and inner branch colors, but replaces each leaf label with the `int` that reports how many of that leaf's ancestors are labeled `Red`. For example, if we give your function a tree: