Electronic Arts Interview Question

center node of any linkedlist

Interview Answer

Anonymous

Mar 7, 2024

make slow and fast node initially at head than traverse from head to tell and remember slow have to take one step and fast two steps. Once you reach fast==null return slow.val(In java) this will be yours center node.