We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#113 からの派生
data Tree = Leaf Int | Node Tree Tree -- より一般化したもの data Tree a = Leaf a | Node (Tree a) (Tree a)
-- 部分木を左右反転させた木を返す mirror :: Tree a -> Tree a -- 葉の数を返す count :: Tree a -> Int -- 木の高さを返す depth :: Tree -> Int -- 木が平衡かどうか balanced :: Tree -> Bool -- 葉の値を集めてリストにして返す leaves :: Tree a -> [a] -- 左の部分木を返す left :: Tree a -> Maybe (Tree a) -- 右の部分木を返す right :: Tree a -> Maybe (Tree a)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
#113 からの派生
definition
operation
reference
The text was updated successfully, but these errors were encountered: