【发布时间】:2015-08-13 05:27:19
【问题描述】:
我的笔记包括以下二叉树的定义:
datatype tree = Empty | Node of tree * int * tree
我怎么知道定义中的第二个选项是否应该表示:
Node of (tree * int * tree)
或
Node of tree * int * tree?
谢谢,
布莱曼
【问题讨论】:
标签: functional-programming sml
我的笔记包括以下二叉树的定义:
datatype tree = Empty | Node of tree * int * tree
我怎么知道定义中的第二个选项是否应该表示:
Node of (tree * int * tree)
或
Node of tree * int * tree?
谢谢,
布莱曼
【问题讨论】:
标签: functional-programming sml
Node of (tree * int * tree)和Node of tree * int * tree是一样的
【讨论】:
(Node of tree) * int * tree...再次感谢!
Constructor 或Constructor of type。所以(Node of tree) * int * tree 的格式不正确。顺便说一句——如果马特的回答解决了你的问题,感谢他的最好方法是通过点击左边的绿色复选框来“接受”这个答案。这会让其他人知道你的问题已经解决,并且会给他+15声望点(而你自己+2)。