2,787 views
1 votes
1 votes
a b c d e f / null

Assume the above is a singly linked list

first is pointing to a

what will be the output after this

struct node *p;

p = first->link->link->link;

p->link->link=first->link->link;

first->link->link->link=p->link;

printf("%c" , first->linl->link->link-link->data);

1 Answer

Best answer
4 votes
4 votes

Initially Linked list will be like 

After Statement 1 : p = first->link->link->link;

After Statement 2 : p->link->link=first->link->link;

After Statement 3 : first->link->link->link=p->link;

Now if we traverse  first->link->link->link-link->data; 'c' will be printed

selected by

Related questions