全文预览

商人过河问题

上传者:蓝天 |  格式:doc  |  页数:16 |  大小:142KB

文档介绍
                         delete_link();Р                            exit( EXIT_FAILURE);Р                     }//ifР                     for( i = 0; i < level; i++){Р                            *p1++ = vert - i;Р                            *p2++ = rear + M + i;Р                     }Р                     for( i = 1; i <= diag; i++){Р                            *p1++ = head - i;Р                            *p2++ = rear + i;Р                     }Р                     *p1 = *p2 = -1;Р              }//if(sum)Р       }//ifР}Р Р Рvoid path( void)Р{Р       int *p;Р       int i, j;Р Р       stack.array[stack.top] = up_bound;Р       stack.mark[stack.top] = 0;Р       elements[up_bound].go_flag = YES;Р Р       while( stack.top >= 0 && stack.top < STACK_Vol){Р              i = stack.array[stack.top];

收藏

分享

举报
下载此文档