- 博客(3)
- 收藏
- 关注
原创 23. Merge k Sorted Lists
题目 Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 题意 合并k个有序链表成1个有序链表 分析 将合并k个成1个链表 分解为: k个链表两两合并, 之后得到的k’链表再两两合并,直到最后只剩下一个链表 实现 class S
2018-01-07 13:44:19 261
原创 4. Median of Two Sorted Arrays
题目There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1:nums1 = [1, 3] nums
2018-01-07 12:11:42 211
原创 ex.8.3
题目STINGY SAT is the following problem:given a set of clauses(each a disjunction of literals) and an integer k, find a satisfy assignment in which at most k variables are true, if such an assignment exi
2018-01-01 19:23:47 184
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人