Corrects README.md

上级 8e060ad0
......@@ -141,11 +141,16 @@ public final class NullNode implements Node {
Then we can construct and traverse the binary tree without errors as follows.
```java
Node root =
new NodeImpl("1", new NodeImpl("11", new NodeImpl("111", NullNode.getInstance(),
NullNode.getInstance()), NullNode.getInstance()), new NodeImpl("12",
NullNode.getInstance(), new NodeImpl("122", NullNode.getInstance(),
NullNode.getInstance())));
var root = new NodeImpl("1",
new NodeImpl("11",
new NodeImpl("111", NullNode.getInstance(), NullNode.getInstance()),
NullNode.getInstance()
),
new NodeImpl("12",
NullNode.getInstance(),
new NodeImpl("122", NullNode.getInstance(), NullNode.getInstance())
)
);
root.walk();
// 1
......
......@@ -37,7 +37,7 @@ public class App {
* @param args command line args
*/
public static void main(String[] args) {
Node root = new NodeImpl("1",
var root = new NodeImpl("1",
new NodeImpl("11",
new NodeImpl("111", NullNode.getInstance(), NullNode.getInstance()),
NullNode.getInstance()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册