Computer Science, asked by einsteinpavan7126, 9 months ago

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 MrZeref
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