What Is The Functionality Of The Following Piece Of Codep Pre #82

What is the functionality of the following piece of code?</p> <pre><code class="language-java"> 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; } </code></pre>

Online Quiz This multiple choice question (MCQ) is related to the book/course gs gs121 Data Structures and Algorithms. It can also be found in gs gs121 Abstract Data Types - Singly Linked Lists - Quiz No.2.

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

Similar question(s) are as followings:



Online Quizzes of gs121 Data Structures and Algorithms

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background