F# 树
来源:互联网 发布:mac怎么分区移动硬盘pc 编辑:程序博客网 时间:2024/05/16 11:11
树1
> type BinTree<'a, 'b> = | Leaf of 'a | Node of BinTree<'a, 'b> * 'b * BinTree<'a, 'b>;;type BinTree<'a,'b> = | Leaf of 'a | Node of BinTree<'a,'b> * 'b * BinTree<'a,'b>> let t1 = Node(Node(Leaf 1, "cd", Leaf 2), "ab", Leaf 3);;val t1 : BinTree<int,string> = Node (Node (Leaf 1,"cd",Leaf 2),"ab",Leaf 3)> let rec depth = function | Leaf _ -> 0 | Node (t1, _, t2) -> 1 + max (depth t1) (depth t2);;val depth : _arg1:BinTree<'a,'b> -> int> depth t1;;val it : int = 2
0 0
- F# 树
- 树 problem f
- f
- f
- f
- f
- f
- F#
- f
- F
- f
- f
- f
- f
- f
- f
- F
- f
- 深入理解SQL的四种连接-左外连接、右外连接、内连接、全连接
- 扣丁学堂笔记第27天NDK、屏幕适配与APP上线
- 剑指Offer——n个0到n-1的数里重复的数字
- 小米笔试题 风口的猪-中国牛市
- LeetCode 121 -Best Time to Buy and Sell Stock ( JAVA )
- F# 树
- 密码验证合格程序(华为oj)
- 链表迭代器
- 3、MongoDB数据库集合常用操作
- 文章标题
- iOS简单动画效果
- eclipse 调试模式下修改变量值
- android中的帧布局(frameLayout)
- java面向对象程序设计