fast_ptr would become NULL when there are even elements in the list and not NULL for odd elements . We need to skip the middle node for odd case and store it somewhere so that we can restore the original list
if ( fast_ptr != None ) : NEW_LINE INDENT midnode = slow_ptr NEW_LINE slow_ptr = slow_ptr . next NEW_LINE DEDENT