|
@@ -272,8 +272,8 @@ public class Node {
|
|
}
|
|
}
|
|
|
|
|
|
private Node reduce() {
|
|
private Node reduce() {
|
|
- HashSet<Node> uniqueC = new HashSet<>();
|
|
|
|
- HashSet<Node> dupC = new HashSet<>();
|
|
|
|
|
|
+ List<Node> uniqueC = new ArrayList<>();
|
|
|
|
+ List<Node> dupC = new ArrayList<>();
|
|
for (Node child : this.children) {
|
|
for (Node child : this.children) {
|
|
if (child.inSet(uniqueC))
|
|
if (child.inSet(uniqueC))
|
|
dupC.add(child);
|
|
dupC.add(child);
|
|
@@ -299,6 +299,15 @@ public class Node {
|
|
return new Node(null, result);
|
|
return new Node(null, result);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private boolean inSet(List<Node> h) {
|
|
|
|
+ for (Node curr : h) {
|
|
|
|
+ if (curr.equals(this)) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
private boolean inSet(HashSet<Node> h) {
|
|
private boolean inSet(HashSet<Node> h) {
|
|
for (Node curr : h) {
|
|
for (Node curr : h) {
|
|
if (curr.equals(this)) {
|
|
if (curr.equals(this)) {
|