forked from rampatra/Algorithms-and-Data-Structures-in-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBinaryNode.java
More file actions
29 lines (24 loc) · 686 Bytes
/
BinaryNode.java
File metadata and controls
29 lines (24 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.rampatra.base;
/**
* Created by IntelliJ IDEA.
* User: rampatra
* Date: 4/11/15
* Time: 7:11 PM
* To change this template go to Preferences | IDE Settings | File and Code Templates
*/
public class BinaryNode<E extends Comparable<E>> {
public E value;
public BinaryNode<E> left;
public BinaryNode<E> right;
public BinaryNode(E value, BinaryNode<E> left, BinaryNode<E> right) {
this.value = value;
this.left = left;
this.right = right;
}
public BinaryNode(BinaryNode<E> node) {
if (node == null) return;
this.value = node.value;
this.left = node.left;
this.right = node.right;
}
}