Question: 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
Get step-by-step solutions from verified subject matter experts
