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
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
Computer Science,
4 months ago
Math,
4 months ago
Science,
4 months ago
English,
10 months ago
Physics,
1 year ago
Social Sciences,
1 year ago