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

Sparse table class and tests added #388

Closed
wants to merge 2 commits into from

Conversation

sHiVaNgI821
Copy link
Contributor

Added a class for a sparse table, that can be used to answer range queries on a given array efficiently. It requires a precomputation that takes O(nlogn) time and space. It is added to the miscellaneous_data_structures directory.

References to other Issues or PRs or Relevant literature

Brief description of what is fixed or changed

Other comments

@codecov
Copy link

codecov bot commented May 11, 2021

Codecov Report

Merging #388 (0ebbf28) into master (0f23c98) will decrease coverage by 0.013%.
The diff coverage is 97.368%.

@@              Coverage Diff              @@
##            master      #388       +/-   ##
=============================================
- Coverage   98.574%   98.560%   -0.014%     
=============================================
  Files           25        26        +1     
  Lines         3297      3335       +38     
=============================================
+ Hits          3250      3287       +37     
- Misses          47        48        +1     
Impacted Files Coverage Δ
...ucts/miscellaneous_data_structures/sparse_table.py 97.222% <97.222%> (ø)
...astructs/miscellaneous_data_structures/__init__.py 100.000% <100.000%> (ø)

Impacted file tree graph

@Smit-create
Copy link
Member

Also, please link the issues that are all related to sparse table so that we can have a track of them. Basic structure and API looks fine to me.

Comment on lines 1 to 2
import math

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry forgot to remove it

@czgdp1807
Copy link
Member

Closing in favour of #414

@czgdp1807 czgdp1807 closed this Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants