I have a homework problem, which asks me to overload == operator to compare two linked-list. And i need to do this in recursion.
Here is my .h file
class LList {
public:
friend bool operator == (const LList& lfSide, const LList& rtSide);
private:
struct Node {
int item;
Node* next;
};
friend bool operator == (const LList& lfSide, Node* headlf, const LList& rtSide, Node* headrt);
Node* head;
}
I tried to use a helper function to make the recursion happen, but it still gives error saying Node is not defined.
friend bool operator == (const LList& lfSide, Node* headlf, const LList& rtSide, Node* headrt);
Can anyone help me with this?