Skip to content

Commit cae666b

Browse files
authored
Rename query_impl to query for clarity
1 parent 85e20f4 commit cae666b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/data_structures_[l,r)/seg_tree_uncommon/kth_smallest_query.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ struct kth_smallest {
2020
//! @space O(log(maxv - minv)) for recursion stack; no
2121
//! new nodes are allocated
2222
int query(int l, int r, int k) {
23-
return query_impl(k, pst.root_l, pst.root_r,
23+
return query(k, pst.root_l, pst.root_r,
2424
pst.roots[l], pst.roots[r]);
2525
}
26-
int query_impl(int k, int tl, int tr, int vl, int vr) {
26+
int query(int k, int tl, int tr, int vl, int vr) {
2727
if (tr - tl == 1) return tl;
2828
int tm = tl + (tr - tl) / 2;
2929
int left_count = pst.tree[pst.tree[vr].lch].sum -
3030
pst.tree[pst.tree[vl].lch].sum;
3131
if (left_count >= k)
32-
return query_impl(k, tl, tm, pst.tree[vl].lch,
32+
return query(k, tl, tm, pst.tree[vl].lch,
3333
pst.tree[vr].lch);
34-
return query_impl(k - left_count, tm, tr,
34+
return query(k - left_count, tm, tr,
3535
pst.tree[vl].rch, pst.tree[vr].rch);
3636
}
3737
};

0 commit comments

Comments
 (0)