Question:
Write a function in C++ to merge two already sorted linked lists, do not use recursion.
Given a data structure:
class Node {
public:
int data; Node* next;
};
Implement the function:
Node* Merge (Node* head1, Node* head2)
{
…
}
It takes in two already sorted linked lists (in ascendant order, duplicates allowed)