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

update segmenttree docstrings Fixes #9943 #9975

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

aryandgandhi
Copy link
Contributor

@aryandgandhi aryandgandhi commented Oct 7, 2023

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • [x ] I have read CONTRIBUTING.md.
  • [x ] This pull request is all my own work -- I have not plagiarized.
  • [x ] I know that pull requests will not be merged if they fail the automated tests.
  • [x ] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [x ] All new Python files are placed inside an existing directory.
  • [ x] All filenames are in all lowercase characters with no spaces or dashes.
  • [x ] All functions and variable names follow Python naming conventions.
  • [ x] All function parameters and return values are annotated with Python type hints.
  • [ x] All functions have doctests that pass the automated testing.
  • [x ] All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

@algorithms-keeper algorithms-keeper bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed tests are failing Do not merge until tests pass labels Oct 7, 2023
@algorithms-keeper algorithms-keeper bot removed the tests are failing Do not merge until tests pass label Oct 7, 2023
@aryandgandhi
Copy link
Contributor Author

@cclauss please approve this PR for hacktoberfest and add the hacktoberfest-accepted label after PR merging. Thank you!

Comment on lines 8 to 10
self.st = [0] * (
4 * self.N
) # approximate the overall size of segment tree with array N
Copy link
Member

@cclauss cclauss Oct 7, 2023

Choose a reason for hiding this comment

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

I gotta say that overall I am not a fan of these single variable names and uppercase variable names!!!
This looks like it was literally ported from some other language with minimal modifications.

a has no data type and no self-documenting name and the class version is uppercase. If find it unreadable.

Suggested change
self.st = [0] * (
4 * self.N
) # approximate the overall size of segment tree with array N
# approximate the overall size of the segment tree with array N
self.st = [0] * (4 * self.N)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, I'll make an issue for people to tackle naming issues in the repository, seems like it was an older thing

@algorithms-keeper algorithms-keeper bot removed the awaiting reviews This PR is ready to be reviewed label Oct 17, 2023
@cclauss cclauss merged commit b5786c8 into TheAlgorithms:master Oct 17, 2023
2 checks passed
sedatguzelsemme pushed a commit to sedatguzelsemme/Python that referenced this pull request Sep 15, 2024
…#9975)

* update docstrings

* update docstrings

* update docstrings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This PR modified some existing files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants