Electronic Arts Interview Question

1.Introduce myself 2.Ask algorithm problems. The problem is reverse the linked list. And another one (Sorry, I forgot the question, but it isn't hard). 3. Ask the resume's problem.

Interview Answer

Anonymous

Feb 3, 2017

public void reverseLinkedListRecursive(Node currNode){ if(currNode==null) return; if(currNode.next==null){ head = currNode; return; } reverseLinkedListRecursive(currNode.next); currNode.next.next = currNode; currNode.next = null; }