Sum Scan With Tail Recursion Assignment

From CSE425S Wiki
Revision as of 21:23, 7 February 2022 by Dennis.cosgrove (talk | contribs) (Created page with "=Motivation= Gain experience with converting from head recursion to tail recursion with a twist. Taking the standard simple approach would leave with you with a result opposi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Motivation

Gain experience with converting from head recursion to tail recursion with a twist. Taking the standard simple approach would leave with you with a result opposite of the desired order.

A Sting In the Tail

Everything does not always goes perfectly smoothly on the jouney to the land of tail recursion. Some operations are transitive (for example: + and *) and they can be performed in either order. This is not the case for list construction with ::.

Code to Implement

Reimplement Sum Scan with tail recursion.

file: src/main/sml/warmup_sum_scan_tail/sum_scan_tail.sml Smlnj-logo.png
functions: sum_scan_tail

Left to decide between taking

Test

file: unit_test_sum_scan_tail.sml
source folder: src/test/sml/warmup_sum_scan_tail