Advertisement
Guest User

Untitled

a guest
Feb 13th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.30 KB | None | 0 0
  1. let rec wysokosc drzewo
  2.     match drzewo with
  3.     | Lisc -> 1
  4.     | KorzenZ2Pot _ l r -> 1 + System.Math.Max(wysokosc l, wysokosc r)
  5.     | KorzenZ1Pot _ d -> 1 + wysokosc d
  6.  
  7. let rec suma drzewo
  8.     match drzewo with
  9.     | Lisc -> 1
  10.     | KorzenZ2Pot _ l r -> 1 + wysokosc l + wysokosc r
  11.     | KorzenZ1Pot _ d -> 1 + wysokosc l
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement