Computer Science, asked by shanmukasunny333, 10 months ago

What is the functionality of the following code?
public void function(Node node)
if size ==0)
head = node;
else
Node temp,cur
for cur= head; (temp = cur.getNext()) != null;cur = temp);
cur.setNextinode);
size++
1
A
Inserting a node at the beginning of the list
B
Deleting a node at the beginning of the list
C
Inertir andeste end of the
Deleting a node at the end of the list​

Answers

Answered by StephenDeva
5

Answer:

A » Inserting a node at the beginning of the list

Explanation:

No need to look deeper just look at the first line if(size ==0) then head = node. So for sure it's not deleting becz if empty list then how head and node? So it's not B and C.. So it's A

Similar questions