Facebook Interview Question: Reverse print single linked l... | Glassdoor

Interview Question

Backend Engineer Interview

Reverse print single linked list.

Answer

Interview Answer

1 Answer

0

printNode(Node n)
{
  if (n == null) return;
  printNode(n->next);
  print(" " + n.value);
}

AlgorithmJunky on Jun 13, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.