Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec printInOrder tree key codeList :((char*int list)list)=
- match tree with
- |Node (value, left, right) ->
- printInOrder left (key @ [1]) codeList
- printInOrder right (key @ [0]) codeList
- |Leaf (value, symb) ->
- printfn "Symbol '%c' %A" symb key
- let codeList' = codeList @ [(symb, key)]
- if treesList.Length = codeList'.Length then codeList' else ()
- |Empty -> ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement