Answered step by step
Verified Expert Solution
Question
1 Approved Answer
by using only basic operations can anyone help me? I'm able to get a list of just n - 1 but can't get the list
by using only basic operations can anyone help me?
I'm able to get a list of just n - 1 but can't get the list to continue to zero here's what i have so far:
fun makelist x = if null x then nil else hd x - 1 :: makelist(tl x);
This is in sml in case anybody didn't know, thank you in advance :)
- Write a function makeLst of type int -> int list that takes as input a positive integer n and returns the list [1, 2, ..., n]. Your function does not need to work with non-positive integer
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started