-
Notifications
You must be signed in to change notification settings - Fork 829
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
构造线段树中的一个小 BUG #14
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/liuyubobobo/Play-with-Data-Structures/blob/master/09-Segment-Tree/03-Building-Segment-Tree/src/SegmentTree.java#L20-L26
线段树
build
中的递归终止条件少一个l > r
, 当构造函数传入空数组时会使l > r
导致无限递归. (虽然应该不会有传入空数组的情况, 但感觉还是要加上这个条件比较好)The text was updated successfully, but these errors were encountered: