LinkedList
Last updated
Was this helpful?
Last updated
Was this helpful?
dummy node
2 pointers: fast and slow. while(fast != null && fast.next != null) fast = head, slow = head, fast = fast.next.next, slow = slow.next
, slow stop in the middle or right middle.
reverse: track at least 2 points
cycle detection, 2 pointers, Floyd cycle
iterative: left + curr + right, 3 points
recursive: return last node
+ - * /
etc operationsKey points: carry
curr % 10
curr / 10
Start from right end plus max length max(len1, len2) + 1
, multiply max length len1 + len2
dummy node
two pointers: