The sum of two linked lists can be found either in an iterative way or recursive way. In this article, we will discuss the recursive way and in the next article, we will discuss the iterative approach. With the iterative approach, we first need to reverse the list and then find the sum and again the resultant linked list is reversed to get the final result. Hence, the original list is modified.

But if there is a restriction on modifying the list then there is no way to use the iterative approach and recursive approach needs to be implemented.
Continue Reading…

#algorithm #datastructure #linkedlists #java

Add Two Numbers Represented by Linked Lists | DevGlan
7.90 GEEK