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 segment tree #822

Open
wants to merge 92 commits into
base: master
Choose a base branch
from

Conversation

AliceRoselia
Copy link

I am adding the segment tree data structure to the Datastructures.jl.

Thanks for reviewing and I am hopeful this code will be accepted.

@AliceRoselia
Copy link
Author

What happened? I didn't mess with these files.

I don't know anymore what is happening.

@AliceRoselia
Copy link
Author

AliceRoselia commented Jul 22, 2022

Okay... whatever. The old stuffs are failing? Whatever. I think this is fixed/something in the future updates but I don't know.

@StephenVavasis
Copy link
Contributor

I think the reason for these errors is that you have defined a function sizeof in your code without first importing Base.sizeof. This means that your sizeof function hides all the sizeof methods in Base. Since Base.sizeof is a widely used function, hiding it will break many things.

Please note that the principal maintainer of DataStructures, user @oxinabox, has prioritized the process of getting all the current data structures ready for a major release, and inclusion of new data structures has a lower priority.

@SyxP
Copy link

SyxP commented Sep 1, 2023

I have argued before that such Data Structures are really only useful in an competitive programming environment. For instance, one can do these exact operations on an AVL/Red Black Tree.

I think there is greater utility in this data structure being a standalone package, rather than being included in DataStructures per se.

Lastly the usage of the term Segment Tree is actually ambiguous. The term is used here in a competitive programming setting is different then https://en.wikipedia.org/wiki/Segment_tree as it makes the assumption that all segments are length 1.

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 this pull request may close these issues.

3 participants