Pergunta de entrevista da empresa Adobe

Given a linked list with n nodes and each node having a link to it's next node and a link to it's next node's next node, write an expression to find the no of ways to traverse from the first node to the last one.

Resposta da entrevista

Sigiloso

9 de mar. de 2018

If Ti is the no of ways to traverse list with i nodes then Tn = Tn-1 + Tn-2 where T1 = T2 = 1