mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-15 19:28:47 +00:00
Constructors capitalized
This commit is contained in:
parent
3bf36ae719
commit
4879a02753
18 changed files with 147 additions and 145 deletions
|
|
@ -1,15 +1,15 @@
|
|||
fun insert (tree, value) {
|
||||
case tree of
|
||||
`Empty -> return `Node (value, `Empty, `Empty)
|
||||
| `Node (x, left, right) ->
|
||||
Empty -> return Node (value, Empty, Empty)
|
||||
| Node (x, left, right) ->
|
||||
if x > value
|
||||
then return `Node (x, insert (left, value), right)
|
||||
else return `Node (x, left, insert (right, value))
|
||||
then return Node (x, insert (left, value), right)
|
||||
else return Node (x, left, insert (right, value))
|
||||
fi
|
||||
esac
|
||||
}
|
||||
|
||||
tree := `Empty;
|
||||
tree := Empty;
|
||||
|
||||
for i := 0, i <= 10, i := i+1 do
|
||||
printf ("%s\n", tree.string);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue