Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2) Given the following data type: datatype cTree = EMPTY I (where the node basically holds a string, and a count of how many times
2) Given the following data type: datatype cTree = EMPTY I (where the node basically holds a string, and a count of how many times the string occurs) you may presume that the append function is available (as defined in class). write a function called detree with the type spec: with the following sample runs: - detree (NODE("x",2, (NODE("W",1, EMPTY, EMPTY)NODE("y",3, EMPTY, EMPTY))) NODE of string int cTree cTree; detree cTree -> string list val it ["w", "X", "X", "y", "y", "y"] : string list - detree EMPTY; val it = [] : string list 2) Given the following data type: datatype cTree = EMPTY I (where the node basically holds a string, and a count of how many times the string occurs) you may presume that the append function is available (as defined in class). write a function called detree with the type spec: with the following sample runs: - detree (NODE("x",2, (NODE("W",1, EMPTY, EMPTY)NODE("y",3, EMPTY, EMPTY))) NODE of string int cTree cTree; detree cTree -> string list val it ["w", "X", "X", "y", "y", "y"] : string list - detree EMPTY; val it = [] : string list
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