Skip to content

Commit f681206

Browse files
committed
reorder functions
1 parent 27b6869 commit f681206

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/data_structures/deque_op/queue_only.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ template<class T, class F> struct deq {
2020
int siz() { return sz(l) + sz(r); }
2121
T front() { return (empty(l) ? r[0] : l.back())[0]; }
2222
T back() { return (empty(r) ? l[0] : r.back())[0]; }
23-
void push_back(T elem) {
24-
r.push_back(
25-
{elem, empty(r) ? elem : op(r.back()[1], elem)});
26-
}
2723
void pop_front() {
2824
if (empty(l)) {
2925
vector<T> a(sz(r));
@@ -33,6 +29,10 @@ template<class T, class F> struct deq {
3329
}
3430
l.pop_back();
3531
}
32+
void push_back(T elem) {
33+
r.push_back(
34+
{elem, empty(r) ? elem : op(r.back()[1], elem)});
35+
}
3636
void rebuild(const vector<T>& a, int sz_le) {
3737
vector<T> presum(sz(a));
3838
partial_sum(rend(a) - sz_le, rend(a),

0 commit comments

Comments
 (0)