typical microsoft interview question [#4011952@0 -ROLIA.NET 相约加拿大网上社区 之 枫下论坛 & 枫下部落, 枫下论坛主坛 ]
typical microsoft interview question
by
ualarm
(pump)
at
2007.10.23 23:12
(#4011952@0)
use recursion, I was asked same question from microsoft:
if( node-> next == null )
return null;
else if( node->next->next == null )
return null;
....
else if( node->next->next... == null ) //this is te 5th
return node;
else
return func(node->next);
can also use loop, microsoft will ask which one is better? loop or recursion, and why?
Nonsense question.