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

Conversation

wangzongxu
Copy link

L11:因为要求是求第K大的数,由于分区是从小到大排序,第K大的数就是第 len - (k - 1) 小的数;
L14:如果基准点到了第一个或者最后一个,也就是说已经把三份的数组分成了两份,说明已经从小到大排序完成了,这时直接根据要求,给出第k个即可

L11:因为要求是求第K大的数,由于分区是从小到大排序,第K大的数就是第 len - (k - 1) 小的数;
L14:如果基准点到了第一个或者最后一个,也就是说已经把三份的数组分成了两份,说明已经从小到大排序完成了,这时直接根据要求,给出第k个即可
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.

1 participant