TGPSC HMWSSB Manager 2015 Paper 2 CSE · Question 142
Question 142 of the TSPSC Manager (Engineering), HMWSSB, 2015: Paper 2 (Computer Science & Information Technology) (1 November 2015). Try it first, then open the answer. The explanation is in the practice app with the All-in-One Pass.
Which of the following is the correct sequence of the statements to be executed to insert a node after a node whose address is p? The pointer field nextptr points to the next node and the address of the new node is q.
- p->nextptr=q; q->nextptr=p;
- p->nextptr=q; q->nextptr=p->nextptr;
- q->nextptr=p->nextptr; p->nextptr=q;
- q->nextptr=p->nextptr; p->nextptr=q->nextptr;
Show answer
Answer: (3) q->nextptr=p->nextptr; p->nextptr=q;
Explanation: open it in the practice app. It needs the ₹149 All-in-One Pass: one payment for every exam on the site.