Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions