摘要: ```/** * 21. Merge Two Sorted Lists * 1. Time:O(min(m,n)) Space:O(1) * 2. Time:O(m+n) Space:O(m+n) */// 1. Time:O(min(m,n)) Space:O(1)class Solution { public ListNode mergeTwoLists(ListNode l1, Lis... 阅读全文
posted @ 2020-05-10 10:44 AAAmsl 阅读(75) 评论(0) 推荐(0) 编辑
摘要: ``` /** * 88. Merge Sorted Array * 1. Time:O(m+n) Space:O(m) * 2. Time:O(m+n) Space:O(1) */ // 1. Time:O(m+n) Space:O(m) class Solution { public void merge(int[] nums1, int m, int[] nums2, int n) { in 阅读全文
posted @ 2020-05-10 10:43 AAAmsl 阅读(68) 评论(0) 推荐(0) 编辑
摘要: ``` /** * 147. Insertion Sort List * 1. Time:O(n2) Space:O(1) * 2. Time:O(n2) Space:O(1) */ // 1. Time:O(n2) Space:O(1) class Solution { public ListNode insertionSortList(ListNode head) { ListNode dum 阅读全文
posted @ 2020-05-10 10:42 AAAmsl 阅读(56) 评论(0) 推荐(0) 编辑
摘要: ``` /** * 307. Range Sum Query - Mutable * 1. Time:O(n) Space:O(1) * 2. Time:O(logn) Space:O(1) * 3. Time:O(logn) Space:O(1) */ // 1. Time:O(n) Space:O(1) class NumArray { private int[] nums; public N 阅读全文
posted @ 2020-05-10 10:40 AAAmsl 阅读(71) 评论(0) 推荐(0) 编辑