Monday, September 20, 2010

sum of two linked list

Take a number 1234. It can be represented in the form of a linked list, where the head of the list points to the node having value 1, that one pointing to 2, that one to 3, and then 4.
Similarly 2 linked lists are given. Their digit count is known to you in advance. You need to add the 2 lists and create a new list without changing the existing list (reversing) or using recursion.

No comments:

Post a Comment