Skip to content

Commit

Permalink
Fix Binary Search Tree insert function (#1167)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikrw authored and cartermp committed Oct 23, 2016
1 parent 46061ef commit f9e6dae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions samples/snippets/fsharp/tour.fs
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,8 @@ module UnionTypes =
| Empty -> Node(item, Empty, Empty)
| Node(x, left, right) as node ->
if item = x then node // No need to insert, it already exists; return the node.
elif item < x then Node(item, insert x left, right) // Call into left subtree.
else Node(item, left, insert x right) // Call into right subtree.
elif item < x then Node(x, insert item left, right) // Call into left subtree.
else Node(x, left, insert item right) // Call into right subtree.

// ---------------------------------------------------------------
// Option types
Expand Down

0 comments on commit f9e6dae

Please sign in to comment.