Skip to content

Commit

Permalink
Fixed major bug in add(x)
Browse files Browse the repository at this point in the history
  • Loading branch information
patmorin committed Jun 20, 2014
1 parent 8914cbf commit 48840f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/SkiplistSSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ bool SkiplistSSet<T>::add(T x) {
Node *w = newNode(x, pickHeight());
while (h < w->height)
stack[++h] = sentinel; // height increased
for (int i = 0; i < w->height; i++) {
for (int i = 0; i <= w->height; i++) {
w->next[i] = stack[i]->next[i];
stack[i]->next[i] = w;
}
Expand Down

0 comments on commit 48840f3

Please sign in to comment.