X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment5.mdwn;fp=exercises%2Fassignment5.mdwn;h=c72ce6dace4fffbeee17bec0c9e100102c7549be;hp=0494fa7d5f379e62aaea4473aca4bfab152e59e7;hb=54e161fd7049591e965de73874c0eb1406bc53e4;hpb=3b82c6f6da5e92a42e99b6afd2c5b7e4d6a75f67 diff --git a/exercises/assignment5.mdwn b/exercises/assignment5.mdwn index 0494fa7d..c72ce6da 100644 --- a/exercises/assignment5.mdwn +++ b/exercises/assignment5.mdwn @@ -144,7 +144,7 @@ Choose one of these languages and write the following functions. 2 2 -9. (More challenging.) Assume you have a `color_tree` whose leaves are labeled with `int`s (which may be negative). For this problem, assume also that the the same color never labels multiple inner branches. Write a recursive function that reports which color has the greatest "score" when you sum up all the values of its descendent leaves. Since some leaves may have negative values, the answer won't always be the color at the tree root. In the case of ties, you can return whichever of the highest scoring colors you like. +9. (More challenging.) Assume you have a `color_tree` whose leaves are labeled with `int`s (which may be negative). For this problem, assume also that no color labels multiple `Branch`s (non-leaf nodes). Write a recursive function that reports which color has the greatest "score" when you sum up all the values of its descendent leaves. Since some leaves may have negative values, the answer won't always be the color at the tree root. In the case of ties, you can return whichever of the highest scoring colors you like. ## Search Trees ##