Vidyalelo
Data Structure · Q83

Introduction to Data Structures

Programming · Data Structure · question 83

Q83

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.setNext(node); size++;

A.
Inserting a node at the beginning of the list
B.
Deleting a node at the beginning of the list
C.
Inserting a node at the end of the list
Answer
D.
Deleting a node at the end of the list

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board