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

Beginner-friendliness of Lazy Segment Tree #216

Open
BarrensZeppelin opened this issue Nov 10, 2022 · 0 comments · May be fixed by #228
Open

Beginner-friendliness of Lazy Segment Tree #216

BarrensZeppelin opened this issue Nov 10, 2022 · 0 comments · May be fixed by #228

Comments

@BarrensZeppelin
Copy link
Contributor

BarrensZeppelin commented Nov 10, 2022

Compared to the Lazy Segment Tree, the Segment Tree template is very beginner friendly.
The three lines you have to change to alter the behaviour of the tree are adjacent, and you don't have to understand the rest of the code to make those changes.

The Lazy Segment Tree template does not have this nice property.
Making that tree compute e.g. sums instead of maximums requires tricky changes in multiple places.
If you know how these trees work you might be able to do it, but otherwise it's basically impossible.
It's probably not possible to make it as nice to modify the behaviour as it is in the ordinary Segment Tree, but a little help can go a long way. 🙂

I don't have a concrete idea for how to improve it (which is why I'm submitting an issue instead of a pull request), but maybe we can discuss.
I know that beginner-friendliness is not a primary goal of kactl, but it may be possible to improve it without sacrificing the other goals.

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

Successfully merging a pull request may close this issue.

1 participant