Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overloads to segtree functions for convenience #10

Open
rap2montemayor opened this issue Mar 9, 2022 · 1 comment
Open

Add overloads to segtree functions for convenience #10

rap2montemayor opened this issue Mar 9, 2022 · 1 comment
Assignees

Comments

@rap2montemayor
Copy link
Contributor

Right now, the update and query functions for the lazy segtree (and probably some of the other data structures) look like:

void update(int _i, int _j, int v, int p, int i, int j);
int query(int _i, int _j, int p, int i, int j);

Forgetting what values are supposed go into p, i, and j has been the source of a lot of dumb mistakes. I'd like to propose the following overloads to avoid those.

void update(int i, int j, int v) { return update(i, j, v, 1, 0, n-1); }
int query(int i, int j) { return query(i, j, 1, 0, n-1); }
@leloykun
Copy link
Contributor

@rap2montemayor , wanna own this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants