-
-
Save asvnpr/af0ba6a1db4a06e5e9a3903f00146c45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.) | |
fun squareSum nil = 0 | |
| squareSum(h::t) = h*h + squareSum(t); | |
how do tail recursive halp | |
2.) | |
fun secondSmall (null, s) = nil | |
| secondSmall (h::t, s) = | |
if (s > List.nth(t, 0) or s = nil) | |
s = h | |
secondSmall(t, List.nth(t, 0)) | |
else | |
secondSmall(t, s) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment