Corrects README.md
This commit is contained in:
parent
8e060ad0ad
commit
8b92bc6bb6
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user