I need a little help with my new assignment.
Problem:
Given Two Linked List representation of a decimal numbers(238 & 35):-
2->3->8 and,
3->5Add elements so that your Final Linked List must be 2->7->3.
What could be the best approach to solve this problem.
Without doing your homework for you – I think the best general approach would be to break it into three steps.
Reverse both the lists.
Add the elements pairwise, carrying a one where necessary.
Reverse the resulting list.
Since step 1 and step 3 are kind of the same, you probably want to write a separate function for this.
Give it a try, and post again if you need more help.