摘要: LeetCode——Kth Largest Element in an Array Question Find the kth largest element in an unsorted array. Note that it is the kth largest element in the s 阅读全文
posted @ 2017-03-15 14:27 清水汪汪 阅读(150) 评论(0) 推荐(1) 编辑
摘要:  堆排序与快速排序,归并排序一样都是时间复杂度为O(N logN)的几种常见排序方法。学习堆排序前,先讲解下什么是数据结构中的二叉堆。二叉堆的定义二叉堆是完全二叉树或者是近似完全二叉树。二叉堆满足二个特性:1.父结点的键值总是大于或等于(小于或等于)任何一个子节点的键值。2.每个结点的左子 阅读全文
posted @ 2017-03-15 14:07 清水汪汪 阅读(5086) 评论(2) 推荐(1) 编辑