|
|
|
|
|
by nullspace
3249 days ago
|
|
// Flip the BST using pattern matching!
let rec flip bst =
match bst with
| Empty -> bst
| Node(item, left, right) -> Node(item, flip right, flip left)
Without type annotations, how can it tell the flip takes an instance of BST as the parameter? |
|