bro i have marked the lines in while loop as 1,2,3,4 so now in the node 1,node 2, node 3 parts see the code and see the values in the solution and try to relate them
and yeah actually i draw the diagram of the node once and copied that diagram 3 times and so by mistake i didnt changed the value of node 2
Also the node diagram of nodes 1 , 2 , 3 that i draw are before entering while loop after while loop the pointers changed and represented as normal text form under the nodes
see them temp value after node 3 got out of while loop is 2000 right it means it is pointing to node 2
in node 2 prev pointer is pointing to 3000 right