摘要: 先来看最多的线段重合数问题,给出一组线段集合,求最大重合线段数 求解过程: 把一个线段生成一个对象 开始位置start 结束位置end 选按开始位置排序 [1,7] [1,4] [1,9] [2,13] [5,10] 再搞一个有序表(按结束位置排序) 用TreeMap,TreeSet,或Priori 阅读全文
posted @ 2021-08-30 18:24 sherry001 阅读(59) 评论(0) 推荐(0) 编辑
摘要: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文
posted @ 2021-08-30 11:42 sherry001 阅读(48) 评论(0) 推荐(0) 编辑
摘要: Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the LRUCache class: LRUCache(int capacity) Initia 阅读全文
posted @ 2021-08-30 10:50 sherry001 阅读(71) 评论(0) 推荐(0) 编辑
摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 阅读全文
posted @ 2021-08-30 09:43 sherry001 阅读(37) 评论(0) 推荐(0) 编辑