You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
malloc(capacity)
on push: if cur >= capacity:
capacity *= 2; realloc
potentially:
malloc(<initial capacity chosen by profiling, likely at least 9>)
push:
if pos >= capacity:
capacity += initial
last = last->next = malloc(initial)
last[pos%len] = val
pos += 1
pop/peek:
val = last[pos%len]
if pop:
cur -= 1
if pos < capacity - len:
last = last->prev
free(last->next);
last->next = NULL;
return val
The text was updated successfully, but these errors were encountered:
currently:
potentially:
The text was updated successfully, but these errors were encountered: