Skip to content

Commit

Permalink
analyse
Browse files Browse the repository at this point in the history
  • Loading branch information
pangzhiqiang committed Sep 17, 2020
1 parent 320c1a2 commit bf998a4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controller/algorithm/kthlargestelement.go
Expand Up @@ -17,6 +17,9 @@ package algorithm
你可以假设 k 总是有效的,且 1 ≤ k ≤ 数组的长度。
分析:
借鉴快排的划分过程,计算出轴值后,判断轴值与k的大小,选择合适区间
*/

func FindKthLargest(nums []int, k int) int {
Expand Down

0 comments on commit bf998a4

Please sign in to comment.