| 1 | Create new interval [4, 9] | N/A | new = [4,9]->NULL | [1,3]->[6,7]->[8,10]->[12,16]->NULL |
| 2 | Start at head | [1,3] | current = head | [1,3]->[6,7]->[8,10]->[12,16]->NULL |
| 3 | Check if current.end < new.start (3 < 4) | current=[1,3] | Move prev=current, current=current.next | prev=[1,3], current=[6,7] |
| 4 | Check if current.end < new.start (7 < 4) | current=[6,7] | Condition false, stop traversal | prev=[1,3], current=[6,7] |
| 5 | Check overlap: new.start <= current.end (4 <= 7) | current=[6,7] | Merge: new.start = min(4,6)=4, new.end = max(9,7)=9 | new=[4,9] |
| 6 | Remove current [6,7] from list | current=[6,7] | prev.next = current.next ([8,10]) | List: [1,3]->[8,10]->[12,16] |
| 7 | Check next node [8,10] overlap with new [4,9] | current=[8,10] | Overlap: merge new.end = max(9,10)=10 | new=[4,10] |
| 8 | Remove current [8,10] | current=[8,10] | prev.next = current.next ([12,16]) | List: [1,3]->[12,16] |
| 9 | Check next node [12,16] overlap with new [4,10] | current=[12,16] | No overlap (12 > 10), stop merging | List: [1,3]->[12,16] |
| 10 | Insert merged new interval after prev | prev=[1,3] | new.next = prev.next; prev.next = new | List: [1,3]->[4,10]->[12,16] |
| 11 | Insertion complete | N/A | N/A | [1,3]->[4,10]->[12,16]->NULL |