Given a singly linked list, modify the value of first half nodes such that : 1st nodes new value = the last nodes value - first nodes current value 2nd nodes new value = the second last nodes value - 2nd nodes current value, and so on
Answers
Answered by
0
Answer:
Input : 10 -> 4 -> 5 -> 3 -> 6 Output : 4 -> 1 -> 5 -> 3 -> 6 Input : 2 -> 9 -> 8 -> 12 -> 7 -> 10 Output : -8 -> 2 -> -4 -> 12 -> 7 -> 10
Similar questions
English,
6 months ago
Computer Science,
6 months ago
History,
6 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Biology,
1 year ago
Biology,
1 year ago