3k views

The following steps in a linked list

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

result in which type of operation?

1. Pop operation in stack.
2. Removal of a node.
3. Inserting a node.
4. Modifying an existing node.
in DS | 3k views

It is Insertion of node ,

A node have 2 fields associate with it

1. Data ( The information that it conatin )

2 . Next --- ( which point to the next node )

The line P= get node () ; mean you are allocating a space for a new node that you want to create

Then you from second line info(p)=10 mean you are setting the info value to 10

And then you are updating list Field
by Loyal (9.9k points)
selected