Skip to content

Conversation

jakobkogler
Copy link
Member

No description provided.

@tcNickolas
Copy link
Member

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 :-)

@jakobkogler
Copy link
Member Author

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...

@tcNickolas
Copy link
Member

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 :-)

@jakobkogler
Copy link
Member Author

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.

@tcNickolas
Copy link
Member

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.

@jakobkogler
Copy link
Member Author

@tcNickolas Yes, you are correct. I changed it and also added a few additional tiny improvements.

@tcNickolas tcNickolas merged commit dd1bead into cp-algorithms:master Oct 15, 2017
@jakobkogler jakobkogler deleted the sparsetable branch November 16, 2017 17:52
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.

2 participants