Skip to content

Commit 13b9050

Browse files
committed
update time and space complexity
1 parent 2b4b1dc commit 13b9050

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/leetcode/linked_list/merge-two-lists.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export class ListNode {
2020
}
2121

2222
// Time complexity O(n + m), n: list1, m: list2
23+
// Space complexity O(n + m)
2324
export function mergeTwoLists(list1: ListNode | null, list2: ListNode | null): ListNode | null {
2425
if (list1 == null) return list2
2526
if (list2 == null) return list1

0 commit comments

Comments
 (0)