Skip to content

Only one carriage return #2155

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

Merged
merged 10 commits into from
Jun 25, 2020

Conversation

cclauss
Copy link
Member

@cclauss cclauss commented Jun 25, 2020

Describe your change:

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

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@cclauss cclauss requested a review from l3str4nge June 25, 2020 10:28
@TravisBuddy
Copy link

Hey @cclauss,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 08ef56d0-b6cf-11ea-bb0d-6965ce86ea0c

@TravisBuddy
Copy link

Hey @cclauss,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 1e401370-b6d0-11ea-bb0d-6965ce86ea0c

@TravisBuddy
Copy link

Hey @cclauss,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: aac1c5a0-b6d0-11ea-bb0d-6965ce86ea0c

@TravisBuddy
Copy link

Hey @cclauss,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 8f7490f0-b6d2-11ea-bb0d-6965ce86ea0c

@cclauss cclauss force-pushed the only-one-carriage-return branch from 13846d5 to a97691b Compare June 25, 2020 10:56
@github-actions github-actions bot force-pushed the only-one-carriage-return branch from 2cd95a2 to 4978f84 Compare June 25, 2020 10:57
get_height(root.get_right().get_left()):
if get_height(root.get_right().get_right()) > get_height(
root.get_right().get_left()
):
root = left_rotation(root)
Copy link
Member

Choose a reason for hiding this comment

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

right_height = get_height(root.get_right().get_right())
right_left_height = get_height(root.get_right().get_left())
if(right_height > right_left_height):
    root = left_rotation(root)

Now it's unreadable 😢

Copy link
Member Author

Choose a reason for hiding this comment

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

The first variable would be right_right_height which is no more readable than get_height(root.get_right().get_right()).

Copy link
Member

Choose a reason for hiding this comment

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

@cclauss Could we refactor this in this pr? If not i will approve it without and open new with refactor.

get_height(root.get_left().get_right()):
if get_height(root.get_left().get_left()) > get_height(
root.get_left().get_right()
):
Copy link
Member

Choose a reason for hiding this comment

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

left_height = get_height(root.get_left().get_left())
left_right_height = get_height(root.get_left().get_right())
if(left_height > left_right_height):
    root = right_rotation(root)

@TravisBuddy
Copy link

Travis tests have failed

Hey @cclauss,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 3d4bc800-b6d4-11ea-bb0d-6965ce86ea0c

@TravisBuddy
Copy link

Travis tests have failed

Hey @cclauss,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: ce3dfe40-b6d5-11ea-bb0d-6965ce86ea0c

@cclauss
Copy link
Member Author

cclauss commented Jun 25, 2020

@mateuszz0000 Your review please

@cclauss cclauss requested a review from poyea June 25, 2020 17:12
@l3str4nge l3str4nge merged commit 8ab84fd into TheAlgorithms:master Jun 25, 2020
@cclauss cclauss deleted the only-one-carriage-return branch June 25, 2020 17:17
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* updating DIRECTORY.md

* touch

* fixup! Format Python code with psf/black push

* Update word_frequency_functions.py

* updating DIRECTORY.md

* Update word_frequency_functions.py

* Update lfu_cache.py

* Update sol1.py

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
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.

3 participants