由买买提看人间百态

topics

全部话题 - 话题: fastptr
(共0页)
a****n
发帖数: 1887
1
来自主题: JobHunting版 - 问个题目
for single linkedlist, u don't need that number.
1.
get nodes number in cycle = N
2.
for (fastptr = givennode; fastptr < N; fastptr=fastptr->next)
printnode(fastptr);
3.
slowptr = givennode;
do{
printnode(fastptr)
}while (++fastptr != ++slowptr);

cycle?
(共0页)