Vidyalelo
Data Structure · Q69

Introduction to Data Structures

Programming · Data Structure · question 69

Q69

What is the functionality of the following piece of code? public int function(int data) Node temp = head; int var = 0; while(temp != null) if(temp.getData() == data) return var; var = var+1; temp = temp.getNext(); return Integer.MIN_VALUE;

A.
Find and delete a given element in the list
B.
Find and return the given element in the list
C.
Find and return the position of the given element in the list
Answer
D.
Find and insert a new element in the list

Answer: Option C

Solution

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