相关疑难解决方法(0)

获取二叉树并按顺序打印其值的函数

我正在编写一个函数来获取二叉树并以正确的顺序打印出它的值(按顺序颠倒).我遇到的问题是,当我调用函数时,我一直得到一个非详尽的模式错误

 --k is the key and d is the value
 -- l is left tree and r is right tree
treeprint (Node l k d r)      =  treeprint l  ++ show k ++ show d ++ treeprint r 
treeprint Nil=""
Run Code Online (Sandbox Code Playgroud)

haskell

1
推荐指数
1
解决办法
1190
查看次数

标签 统计

haskell ×1