You are viewing a single comment's thread. Return to all comments →
The runtime is not O(n), but O(N+M), because you have to go through both lists in the worst case.
Seems like cookies are disabled on this browser, please enable them to open this website
Merge two sorted linked lists
You are viewing a single comment's thread. Return to all comments →
The runtime is not O(n), but O(N+M), because you have to go through both lists in the worst case.