|
instead of trying to keep your results stored in (c1,w1) which doesnt work as you noticed, try the other solution which is to store them the other place... it works if you store w1 in l2, and forget about rr... remember that anamerge and mergehead are recursive, so you are going to make a bunch of calls all the way down to the base case, then your changes will be applied in reverse as you crawl back up the recursion... so it makes sense to be building on the thing that has a remainder.
hope this helps... jesse.
|
Yes: list recursion is usually right-associative by Mike O'Donnell, 2001, Nov 28
the other place? by Mamun Tanveer, 2001, Nov 28
[] is the place in the base case by Mike O'Donnell, 2001, Nov 28
to: