摘要: 题目: 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. Exam 阅读全文
posted @ 2018-06-08 17:31 板弓子 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 记数据结构中元素的个数为n 列表(List) 列表由array实现,分配的内存是一块连续空间。调取、修改列表元素,返回列表长度,这些操作的时间复杂度都是O(1).而在列表头部进行的操作时间复杂度就比较高,为O(n)。 例如,在个人本地环境中,分别从列表的尾部和头部添加10万个元素,前者花了10ms, 阅读全文
posted @ 2018-06-08 11:38 板弓子 阅读(1281) 评论(0) 推荐(0) 编辑