Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Standard ML - please help

  1. Sep 26, 2011 #1
    Hello, can any one please help:

    Using the SML system to define a datatype for labeled 4-branch trees, the trees with possible
    zero, one, two, three or four branches. Label the nodes of the trees by integers, i.e., no
    polymorphic definition for this problem.
    (b) Draw a concrete 4-branch tree of at least 15 nodes and represent this tree by using your 4- branch tree datatype definition. Your representation has to be accepted by SML as an instance of the datatype 4-branch trees you define.
    (c) Using the SML system to define a function in SML that counts the number of all integer nodes of any integer 4-branch trees.
    (d) Apply this function to your concrete tree to get the correct count

    thanks in advance.
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?