Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 706b18d

Browse files
refactor 215
1 parent d4c42f7 commit 706b18d

File tree

1 file changed

+4
-15
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+4
-15
lines changed

src/main/java/com/fishercoder/solutions/_215.java

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@
44
import java.util.Collections;
55
import java.util.PriorityQueue;
66

7-
/**
8-
* 215. Kth Largest Element in an Array
9-
*
10-
* Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.
11-
12-
For example,
13-
Given [3,2,1,5,6,4] and k = 2, return 5.
14-
15-
Note:
16-
You may assume k is always valid, 1 ≤ k ≤ array's length.
17-
18-
*/
197
public class _215 {
208

219
public static class Solution1 {
@@ -39,10 +27,11 @@ public int findKthLargest(int[] nums, int k) {
3927
}
4028

4129
public static class Solution3 {
42-
/**Quick Select algorithm
30+
/**
31+
* Quick Select algorithm
4332
* Time: O(n) in average, O(n^2) in worst case
44-
*
45-
* Reference: https://discuss.leetcode.com/topic/14611/java-quick-select*/
33+
* Reference: https://discuss.leetcode.com/topic/14611/java-quick-select
34+
*/
4635
public int findKthLargest(int[] nums, int k) {
4736
int start = 0;
4837
int end = nums.length - 1;

0 commit comments

Comments
 (0)