-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
added Sparse-Table article #168
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
Conversation
Is this article based on one of e-maxx's ones, or some other source, or is it an original research? I admit I don't recognize the term "sparse table" in relation to competitive programming, I only know the version in which it's a table with most elements equal to zero but this is clearly not it. P.S. Sorry for the delay reviewing, I'm really short on free time this October :-) |
Sorry, no. This article is not a translation from e-maxx. It's a collection of other articles, tutorials and a few of my own thoughts. E.g. see https://www.hackerearth.com/practice/notes/sparse-table/ or https://www.topcoder.com/community/data-science/data-science-tutorials/range-minimum-query-and-lowest-common-ancestor/ After reading about Hacktoberfest I got motivated and wrote this article without realizing that you actually only collect translations. I still submitted it, because I thought that it will still fit. But you can decide if you want to have the article or not. I will not be mad if you decline it. I can publish the article also on Codeforces blog... |
We're not limited to translations and we absolutely welcome original work! I just wanted to double-check whether there are any resources with which I can compare the contents, since I'm not familiar with this data structure. I'll review this a little later, since it requires careful reading and learning a new concept :-) |
Great. Take your time. Btw, I've compiled and tested the codes for both query types. And if you have any questions, just ping me. |
This looks great, thank you! Just one clarification before I go on and merge this: you say that for a number x the number of 1s in its binary representation is at most floor(log2 x); shouldn't this be ceil(log2 x)? For 15, for example, log2 15 = 3.9, but binary representation of 15 is 1111 with 4 1s. |
@tcNickolas Yes, you are correct. I changed it and also added a few additional tiny improvements. |
No description provided.