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

Create insertion_sort.rb #1222

Merged
merged 4 commits into from
Apr 11, 2024
Merged

Create insertion_sort.rb #1222

merged 4 commits into from
Apr 11, 2024

Conversation

cy-by-side
Copy link
Contributor

@cy-by-side cy-by-side commented Apr 4, 2024

If this pull request (PR) pertains to Chinese-to-English translation, please confirm that you have read the contribution guidelines and complete the checklist below:

  • This PR represents the translation of a single, complete document, or contains only bug fixes.
  • The translation accurately conveys the original meaning and intent of the Chinese version. If deviations exist, I have provided explanatory comments to clarify the reasons.

If this pull request (PR) is associated with coding or code transpilation, please attach the relevant console outputs to the PR and complete the following checklist:

  • I have thoroughly reviewed the code, focusing on its formatting, comments, indentation, and file headers.
  • I have confirmed that the code execution outputs are consistent with those produced by the reference code (Python or Java).
  • The code is designed to be compatible on standard operating systems, including Windows, macOS, and Ubuntu.

@krahets krahets mentioned this pull request Apr 6, 2024
5 tasks
Copy link
Contributor

@khoaxuantu khoaxuantu left a comment

Choose a reason for hiding this comment

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

Hi @cy-by-side, I have a small comment for this PR, the rest LGTM.


### 插入排序 ###
def insertion_sort(nums)
n = nums.length()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
n = nums.length()
n = nums.length

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thx!

@cy-by-side cy-by-side closed this Apr 7, 2024
@cy-by-side cy-by-side reopened this Apr 7, 2024
=begin
File: insertion_sort.rb
Created Time: 2024-04-02
Author: Cy ([email protected]) Xuan Khoa Tu Nguyen ([email protected])
Copy link
Owner

Choose a reason for hiding this comment

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

Add a comma between the two ids.

### 插入排序 ###
def insertion_sort(nums)
n = nums.length
# 外循环:已排序区间为[0, i-1]
Copy link
Owner

Choose a reason for hiding this comment

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

# 外循环:已排序区间为 [0, i-1]

Please ensure the comments consistent with those in Python.

Copy link
Owner

@krahets krahets left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@krahets krahets merged commit 49e6a20 into krahets:main Apr 11, 2024
4 checks passed
@krahets krahets added the code Code-related label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Code-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants