从1.5K到18K 一个程序员的5年成长之路(三)
2013-05-22 08:22
141 查看
/** * if has loop return 1 else return 0 */ static int has_loop(List *list) { List *pFast; List *pSlow; pFast = pSlow = list; if (pFast != NULL && pFast->next != NULL) { pFast = pFast->next->next; } else { return 0; } while (pFast != pSlow) { if (pFast != NULL && pFast->next != NULL) pFast = pFast->next->next; else break; pSlow = pSlow->next; } if (pFast == pSlow) return 1; else return 0; }
相关文章推荐
- 从1.5K到18K,一个程序员的5年成长之路
- 从1.5k到18k, 一个程序员的5年成长之路
- 专访雷果国:从1.5K到18K 一个程序员的5年成长之路
- 从1.5K到18K,一个程序员的5年成长之路
- --专访雷果国: 从1.5K到18K 一个程序员的5年成长之路--
- 从1.5k到18k, 一个程序员的5年成长之路
- 从1.5k到18k, 一个程序员的5年成长之路
- 【转载】从1.5K到18K 一个程序员的5年成长之路
- 从1.5K到18K 一个程序员的5年成长之路
- CSDN专访雷果国-从1.5K到18K 一个程序员的5年成长之路
- 从1.5k到18k, 一个程序员的5年成长之路
- 从1.5k到18k, 一个程序员的5年成长之路【转】
- 专访雷果国:从1.5K到18K 一个程序员的5年成长之路
- 专访雷果国: 从1.5K到18K 一个程序员的5年成长之路--
- 专访雷果国:从1.5K到18K 一个程序员的5年成长之路
- --专访雷果国: 从1.5K到18K 一个程序员的5年成长之路--
- 从1.5K到18K 一个程序员的5年成长之路(转)
- 专访雷果国:从1.5K到18K 一个程序员的5年成长之路
- 专访雷果国:从1.5K到18K 一个程序员的5年成长之路
- 从1.5k到18k, 一个程序员的5年成长之路