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 KthNum.js #507

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update KthNum.js #507

wants to merge 1 commit into from

Commits on Mar 4, 2021

  1. Update KthNum.js

    L11:因为要求是求第K大的数,由于分区是从小到大排序,第K大的数就是第 len - (k - 1) 小的数;
    L14:如果基准点到了第一个或者最后一个,也就是说已经把三份的数组分成了两份,说明已经从小到大排序完成了,这时直接根据要求,给出第k个即可
    wangzongxu authored Mar 4, 2021
    Configuration menu
    Copy the full SHA
    c8863c7 View commit details
    Browse the repository at this point in the history