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

feature(swift): Reimplement merge_sort and top_k #898

Merged
merged 4 commits into from
Oct 27, 2023

Conversation

nuomi1
Copy link
Contributor

@nuomi1 nuomi1 commented Oct 27, 2023

If this PR is related to coding or code translation, please fill out the checklist and paste the console outputs to the PR.

  • I've tested the code and ensured the outputs are the same as the outputs of reference code.
  • I've checked the code (formatting, comments, indentation, file header, etc) carefully.
  • The code does not rely on a particular environment or IDE and can be executed on a standard system (Win, macOS, Ubuntu).

@nuomi1
Copy link
Contributor Author

nuomi1 commented Oct 27, 2023

result of `top_k.swift`

最大的 3 个元素为
堆的数组表示:[3, 7, 6]
堆的树状表示:
    /——— 6
——— 3
    \——— 7
result of `merge_sort.swift`

归并排序完成后 nums = [0, 1, 2, 3, 4, 5, 6, 7]

@krahets krahets changed the title Feature/swift feature(swift): Reimplement merge_sort and top_k Oct 27, 2023
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 7605cab into krahets:main Oct 27, 2023
7 checks passed
@krahets krahets added code Code-related bug Bug fixes embellishment Decorative detail or feature labels Oct 27, 2023
@nuomi1 nuomi1 deleted the feature/Swift branch October 27, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes code Code-related embellishment Decorative detail or feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants