Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ private double getUpdateCost(ITree n1, ITree n2) {

private static final class ZsTree {

private int start; // internal array position of leafmost leaf descendant of the root node

private int nodeCount; // number of nodes

private int leafCount;
Expand All @@ -189,11 +187,10 @@ private static final class ZsTree {
private int[] kr;

private ZsTree(ITree t) {
this.start = 0;
this.nodeCount = t.getSize();
this.leafCount = 0;
this.llds = new int[start + nodeCount];
this.labels = new ITree[start + nodeCount];
this.llds = new int[nodeCount];
this.labels = new ITree[nodeCount];

int idx = 1;
Map<ITree,Integer> tmpData = new HashMap<>();
Expand All @@ -210,13 +207,13 @@ private ZsTree(ITree t) {
}

public void setITree(int i, ITree tree) {
labels[i + start - 1] = tree;
labels[i - 1] = tree;
if (nodeCount < i)
nodeCount = i;
}

public void setLld(int i, int lld) {
llds[i + start - 1] = lld + start - 1;
llds[i - 1] = lld - 1;
if (nodeCount < i)
nodeCount = i;
}
Expand All @@ -226,11 +223,11 @@ public boolean isLeaf(int i) {
}

public int lld(int i) {
return llds[i + start - 1] - start + 1;
return llds[i - 1] + 1;
}

public ITree tree(int i) {
return labels[i + start - 1];
return labels[i - 1];
}

public void setKeyRoots() {
Expand Down