If I have, for instance 5 nodes containing the variables 1, 2, 3, 4, 5, how can I link the nodes in order to obtain 3, 2, 1, 4, 5 ? (Change the first node with the third one, and the third with the first). Thanks.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Remove the node with key==1 and insert it after node 2. Then remove node 3 and put it at the head of the list. (By “node 3”, I mean the node with key == 3, not the node that is third in the list, which is now the node with key == 1.)