[SOLVED] 程序代写 SML Language

30 $

File Name: 程序代写_SML_Language.zip
File Size: 235.5 KB

SKU: 7650093657 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


SML Language
1. [15 points Given the following type definitions.
datatype month
= Feb | Mar

Copyright By PowCoder代写加微信 assignmentchef

Jul | Aug | Sep | Oct | Nov I
datatype ‘data tree
Node of ‘data tree
‘data tree;
Implement ML functions according to the given specifications.
a. [5 points] Function isLeapYear of type int
-> bool that returns true if the
given value is a leap year. A year is a leap year if it is divisible by 4 but not
by 100, or it is divisible by 400.
b. [5 points] Function
isValidDate of type (int
that returns true if the given date i.e. (day, month, year) tuple is valid. For
instance, (1, Jan, 2000) is valid while (31, Jun, 2021) is invalid. Note that
your function has to properly handle the dates in February for leap years.
c. (5 points) Function
traverseInOrder oftype int tree
-> int list that
returns the list of nodes when performing inorder traversal on the given tree.
Inorder traversal will traverse the left subtree, visit the root and traverse the
right subtree. For instance, the inorder traversal on the following tree will be
[6, 2, 4, 7, 8, 9.

程序代写 CS代考加微信: assignmentchef QQ: 1823890830 Email: [email protected]

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] 程序代写 SML Language
30 $