摘要: https://www.cnblogs.com/alva-rabbit-hole/p/10070702.html 题目列表 https://zhuanlan.zhihu.com/p/35707293 b站视频 https://www.bilibili.com/video/BV12W411v7rd l 阅读全文
posted @ 2020-12-06 17:42 TR_Goldfish 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 215. 数组中的第K个最大元素 思路: 快速排序 3.8 快速排序 算法描述 算法思想: 对给定数组中的元素进行重新排列, 确定数组中元素的一个位置q, 得到一个快速排序的划分 QUICKSORT功能,将数组A的A[p]到A[q]变为有序(比如从小到大) QUICKSORT(A, p, r) if 阅读全文
posted @ 2020-12-06 11:01 TR_Goldfish 阅读(173) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" func findKthLargest(nums []int, k int) int { left := 0 right := len(nums)-1 length :=len(nums)-k for{ if left == right{// 循环 阅读全文
posted @ 2020-12-06 10:18 TR_Goldfish 阅读(243) 评论(0) 推荐(0) 编辑