From 93145c7da5583070d04e93264697ac86f0d5cd21 Mon Sep 17 00:00:00 2001 From: wunsiang <296672790@qq.com> Date: Fri, 30 Aug 2019 19:00:27 +0800 Subject: [PATCH] =?UTF-8?q?Leetcode=20=E9=A2=98=E8=A7=A3=20-=20=E6=8E=92?= =?UTF-8?q?=E5=BA=8F.md=201.=20Kth=20Element?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notes/Leetcode 题解 - 排序.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/notes/Leetcode 题解 - 排序.md b/notes/Leetcode 题解 - 排序.md index b7204188..15e9026f 100644 --- a/notes/Leetcode 题解 - 排序.md +++ b/notes/Leetcode 题解 - 排序.md @@ -82,8 +82,8 @@ public int findKthLargest(int[] nums, int k) { private int partition(int[] a, int l, int h) { int i = l, j = h + 1; while (true) { - while (a[++i] < a[l] && i < h) ; - while (a[--j] > a[l] && j > l) ; + while (i < h && a[++i] <= a[l]) ; + while (j > l && a[--j] >= a[l]) ; if (i >= j) { break; } @@ -196,7 +196,6 @@ public String frequencySort(String s) {

- ## 1. 按颜色进行排序 [75. Sort Colors (Medium)](https://leetcode.com/problems/sort-colors/description/)