Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. open System
  2. type BinTree =
  3. |Node of int*BinTree*BinTree
  4. |Empty
  5. let myTree =
  6. Node (1, Node (0, Empty, Empty), Node (3, Node(2, Empty, Empty), Empty))
  7. let rec VIVODVSEHVERSHINSODNIMLISTOM tree =
  8. match tree with
  9. |Node (d, Empty, Empty)->()
  10. |Node (d, l, Empty) -> printf "%A " d
  11. |Node (d, Empty, r) -> printf "%A " d
  12. |Node (d, l, r) ->
  13. VIVODVSEHVERSHINSODNIMLISTOM l
  14. VIVODVSEHVERSHINSODNIMLISTOM r
  15.  
  16. VIVODVSEHVERSHINSODNIMLISTOM myTree
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement