Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yongcongwang committed Feb 1, 2024
1 parent a77a55f commit 0c86ea8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Coding/Algorithm/00_pattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ bool empty() { return idx == 0; }
/// loop
int q[N], h = 0, t = 0;
void push(int x) { q[++t % N] = x; }
void push(int x) { q[t++ % N] = x; }
void pop() { h = ++h % N; }
void front() { return q[h]; }
bool empty() { return h == t; }
Expand Down

0 comments on commit 0c86ea8

Please sign in to comment.