Skip to content
Related Articles

Related Articles

ISRO | ISRO CS 2013 | Question 4

View Discussion
Improve Article
Save Article
  • Last Updated : 03 May, 2018
View Discussion
Improve Article
Save Article

The following steps in a linked list

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

result in which type of operation?
(A) pop operation in stack
(B) removal of a node
(C) inserting a node
(D) modifying an existing node

Answer: (C)

Explanation: p = getnode() // getnode() allocates the space which is equal to the size of the node type structure and returns a pointer.
info (p) = 10 // value of the new node is equal to 10
next (p) = list // adding new node to the list.

Clearly, through these steps, insertion of a node is performed.
Option (C) is correct.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!