Skip to content

Add overloads to segtree functions for convenience #10

@rap2montemayor

Description

@rap2montemayor

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); }

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions