Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open System
- type BinTree =
- |Node of int*BinTree*BinTree
- |Empty
- let myTree =
- Node (1, Node (0, Empty, Empty), Node (3, Node(2, Empty, Empty), Empty))
- let rec VIVODVSEHVERSHINSODNIMLISTOM tree =
- match tree with
- |Node (d, Empty, Empty)->()
- |Node (d, l, Empty) -> printf "%A " d
- |Node (d, Empty, r) -> printf "%A " d
- |Node (d, l, r) ->
- VIVODVSEHVERSHINSODNIMLISTOM l
- VIVODVSEHVERSHINSODNIMLISTOM r
- VIVODVSEHVERSHINSODNIMLISTOM myTree
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement