@@ -134,21 +134,37 @@ read strings: [one two three]
...
@@ -134,21 +134,37 @@ read strings: [one two three]
>
>
```
```
You tree should make calls that roughly mirror:
```
one := createTreeNode(uint64(rand.Intn(1000)), "one")
two := createTreeNode(uint64(rand.Intn(1000)), "two")
three := createTreeNode(uint64(rand.Intn(1000)), "three")
four := createTreeNode(uint64(rand.Intn(1000)), "four")
SetLeft(one.oid, two.oid)
SetRight(one.oid, three.oid)
SetLeft(two.oid, four.oid)
```
and then print out, for each node, the label, and the labels of the left and right children:
```
```
> go run tree.go
> go run tree.go
"four"
"one": "two", "three"
"two"
"two": "four", ""
"three"
"three": "", ""
"one"
"four": "", ""
>
>
```
Likewise, another *reader* process running at the same time should see the same tree-node creation and mutation events, construct an exact copy of the tree, and print out the same representation:
```
> go run tree.go -r
> go run tree.go -r
"one": "two", "three"
"one": "two", "three"
"two": "four", ""
"two": "four", ""
"three": "", ""
"three": "", ""
"four": "", ""
"four": "", ""
>
```
```
You will need to define your own implementation for
You will need to define your own implementation for
the tree from scratch. Your tree nodes should conform to
the tree from scratch. Your tree nodes should conform to
`TreeNodeInterface`. Operations consist of creating, setting the left
`TreeNodeInterface`. Operations consist of creating, setting the left