Sum of all Nodes
Iterative and recursive way of finding the sum of data of all the nodes in a linked list.
Iterative Method :
Recursive Method :
Time and Space Complexity :
Time complexity : O(n) Space complexity : O(n)
Contributed by Nitin Ranganath
Last updated