请检查我的代码。我找不到错误在哪里。问题是here。 这里是我的解决方案: # Given a binary tree, find all paths that sum of the nodes in the path equals to a given number target.
#
# A valid path is from root node to any of the leaf n
我的树具有以下数据类型。 data Tree a = Leaf a | Node (Tree a) a (Tree a) deriving (Show)
我想打印使用左到右的深度优先遍历给定树的表示。 目前,我决定采用模式匹配。 showt :: Tree a -> [Char]
showt (Leaf a) = [a]
...
当我尝试使用GHCI运行它,这里的错误,我得到 • Co
我想在一棵二叉树中得到一个父亲的所有下行线,每个父亲有左右手臂,每个手臂有左右手臂等等。 like the following image。 在我的数据库中,我有一张名为users的表,每个用户都有一个父亲id和位置是L或R. 这是我的功能..但它仍然没有得到所有下线。 like the following image。