ods: fix size in DualArrayDeque balance().

This commit is contained in:
Kyle Isom 2018-03-05 17:02:40 -08:00
parent b518212ba7
commit 260a37f13d
1 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ public:
return front.set(front.size() - i - 1, x);
}
else {
return back.set(i - front.size());
return back.set(i - front.size(), x);
}
}
@ -65,7 +65,7 @@ private:
if ((3 * front.size() < back.size()) ||
(3 * back.size() < front.size())) {
std::cerr << "rebalancing\n";
auto n = front.size();
auto n = this->size();
auto nf = n / 2;
Array<T> af(max(2*nf, 1));
for (int i = 0; i < nf; i++) {