We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentd4c42f7 commit706b18dCopy full SHA for 706b18d
src/main/java/com/fishercoder/solutions/_215.java
@@ -4,18 +4,6 @@
4
importjava.util.Collections;
5
importjava.util.PriorityQueue;
6
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
- */
19
publicclass_215 {
20
21
publicstaticclassSolution1 {
@@ -39,10 +27,11 @@ public int findKthLargest(int[] nums, int k) {
39
27
}
40
28
41
29
publicstaticclassSolution3 {
42
-/**Quick Select algorithm
30
+/**
31
+ * Quick Select algorithm
43
32
* 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
+ */
46
35
publicintfindKthLargest(int[]nums,intk) {
47
36
intstart =0;
48
37
intend =nums.length -1;