Home / MCQ Bank / Computer
Computer Introduction To Data Structures

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; }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • Find and return the position of the given element in the list

Related Computer Questions

The syntax of the repeat loop is ______ The statement used to remove indexes on tables is ______ On call of which type of method the new created thread will not start executing? Which of the following names for files not accepted? What is the minimum number of operations required, for a microprocessor with 8 data pins, to read a 32-bit word?