eBay Interview Question
106 Interview Reviews |
Back to all eBay Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Software Engineer at eBay:
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (2)
Node * reverse( Node * ptr , Node * previous)
{
Node * temp;
if(ptr->next == NULL) {
ptr->next = previous;
return ptr;
} else {
temp = reverse(ptr->next, ptr);
ptr->next = previous;
return temp;
}
}
reversedHead = reverse(head, NULL);
Helpful Answer?
Yes |
No
Inappropriate?
To comment on this
question,
Sign In with Facebook or
Sign Up
0 of 0 people found this helpful
by Interview Candidate:
Node temp = null;
Node prev = null;
while (ptr != null) {
temp = ptr.next;
ptr.next = prev;
prev = ptr;
ptr = temp;
}
ptr = prev;