Reversing a linked list recursively This appears to work. Are there any edge cases I am missing? What are your thoughts on the algorithm and implementation?

template &lt;typename el&gt;
void Linkedlist&lt;el&gt;::reverse() {
    Node&lt;el&gt; * oldHead = head;
    Node&lt;el&gt; * tailAfterReversal = recReverseList( head-&gt;getNextNode() );
    oldHead-&gt;setNextNode(NULL);
    tailAfterReversal-&gt;setNextNode(oldHead);
}

// Reverses part of a linked list starting from toRevesrPortionHead, returns the tail node
// after the reversal operation has been performed
template &lt;typename el&gt;
Node&lt;el&gt; * Linkedlist&lt;el&gt;::recReverseList( Node&lt;el&gt; * toReversePortionHead ) {
    if ( toReversePortionHead-&gt;getNextNode() == NULL ) {
        head = toReversePortionHead;
        return toReversePortionHead;
    }

    Node&lt;el&gt; * tailAfterReversal = recReverseList( toReversePortionHead-&gt;getNextNode() );
    tailAfterReversal-&gt;setNextNode(toReversePortionHead);
    toReversePortionHead-&gt;setNextNode(NULL);

    return toReversePortionHead;

}
Algorithm


Since its recursive and O(n), for large n you may get a stack overflow. 
It will fail if the head is null (empty).
This part is redundant:

toReversePortionHead-&gt;setNextNode(NULL); 


Since in each stack call you change the next pointer of the next to the current. For example:  

In the base case :

(4) -&gt; (5) -&gt; (9) -&gt; (10) -&gt; nil

First pop:

(4) -&gt; (5) -&gt; (9) &lt;- -&gt; (10)

Second pop: 

(4) -&gt; (5) &lt;- -&gt; (9) &lt;- (10) 

You will end up with:

(4) &lt;- -&gt; (5) &lt;- (9) &lt;- (10) 

So you set the member next of the resulting node to null

nil &lt;- (4) &lt;- (5) &lt;- (9) &lt;- (10) 



Node

Your node is generic, you should make it a nested class. Also your get and set methods are too verbose and I would personally omit them.



NULL:

If you are using C++11 you should be using nullptr. If you are curious why is a better alternative you could check out this link https://stackoverflow.com/questions/13816385/what-are-the-advantages-of-using-nullptr



Code :

I would change it to this:

template &lt;typename el&gt;
void Linkedlist&lt;el&gt;::reverse() {

    if(!empty())
       recReverseList(head)-&gt; next = nullptr;
}

template &lt;typename el&gt;
Node * Linkedlist&lt;el&gt;::recReverseList( Node* node ) {

    if ( node-&gt;next == nullptr ) 
        return head = node;    

    return recReverseList( node-&gt;next )-&gt;next = node;
}