Skip to content

ISRO Scientist/Engineer CSE 2013Data Structures › Linked Lists

ISRO Scientist/Engineer CSE 2013 PYQ: The following steps in a linked list p = getnode() info(p) = 10 next (p) = list list = p result in which…

The following steps in a linked list

p = getnode() 
info(p) = 10 
next (p) = list 
list = p

result in which type of operation?

  1. A
    Pop operation in stack
  2. B
    Removal of a node
  3. C
    Inserting a node
    Correct answer
  4. D
    Modifying an existing node

Answer

(C) Inserting a node

Approach

Trace the effect of each statement on the linked list. A new node is allocated, its data field is set, its next pointer is linked to the existing list, and the list head is updated to point to the new node. This sequence is the standard way to insert a node at the beginning of a singly linked list.

Reviewed by ISRO IQ Editorial Team.