Skip to content

Beginner-friendliness of Lazy Segment TreeΒ #216

@BarrensZeppelin

Description

@BarrensZeppelin

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.

Metadata

Metadata

Assignees

No one assigned

    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