Skip to content
Related Articles

Related Articles

ISRO | ISRO CS 2018 | Question 19
  • Last Updated : 02 Jul, 2018

A doubly linked list is declared as

struct Node {
       int Value;
       struct Node *Fwd;
       struct Node *Bwd;

Where Fwd and Bwd represent forward and backward link to the adjacent elements of the list. Which of the following segments of code deletes the node pointed to by X from the doubly linked list, if it is assumed that X points to neither the first nor the last node of the list?

(A) X->Bwd->Fwd = X->Fwd; X->Fwd->Bwd = X->Bwd ;
(B) X->Bwd.Fwd = X->Fwd ; X.Fwd->Bwd = X->Bwd ;
(C) X.Bwd->Fwd = X.Bwd ; X->Fwd.Bwd = X.Bwd ;
(D) X->Bwd->Fwd = X->Bwd ; X->Fwd->Bwd = X->Fwd;

Answer: (A)


Quiz of this Question
Please comment below if you find anything wrong in the above post

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :