Find the longest in a linked list recursively

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

string List::Longest(Node* Current) throw (EmptyList)
{

else if (Head != NULL)
        sizestring = Head->Data;
    while(Current->Next != NULL)
    {
        
        if ((Current->Data).length() > size)
        {
            size = (Current->Data).length();
            sizestring = Current->Data;
        }
        Current = Current -> Next;
    }

    return sizestring;
	
	
}


I had to previously write a looping function for finding the longest word in a linked list but now I'm being asked to recursively do it and I just don't know how to do that only passing one pointer parameter. Can anyone help me please?
Can someone please help me with this. I'd really appreciate it.
Topic archived. No new replies allowed.