记录在leetcode的刷题日常,随缘更新
哈希表
time: O(n)
space: O(n)
链表
time: O(m+n)
// TODO time: O(min(m, n))
// 在较短的链表结束后,直接将较长的链表接到已经计算的结果后面
lengthOfLongestSubstring:哈希表、
time: O(n)
space: O(n)
lengthOfLongestSubstring2:
time: O(n)
space: O(1)
time: O(m + n)
space: O(1)
二分查找:
time: O(log(m+n))
space: O(1)