ExamVeda
Login
Home
This question belongs to Javascript Basic And Variables
Basic and Variables
?

Consider the following code snippet
function tail(o) 
{ 
    for (; o.next; o = o.next) ;
    return o;
}
Will the above code snippet work? If not, what will be the error?

Answer & Solution
Correct Answer: Option C
The above code uses a for loop to traverse a linked list data structure and return the last object in the list. This will perfectly work.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.