标签:== while break int span lis 入口 nod ext
class Solution { public: ListNode* EntryNodeOfLoop(ListNode* pHead) { vector<ListNode*> vec; ListNode* list = NULL; if (pHead == NULL) return NULL; int flag = 0; while (pHead != NULL) { vec.push_back(pHead); pHead = (pHead->next); for (int i = 0; i < vec.size(); ++i) { if (pHead == vec[i]) { list = pHead; flag = 1; break; } } if (flag == 1) break; } return list; } };
标签:== while break int span lis 入口 nod ext
原文地址:http://www.cnblogs.com/159269lzm/p/7260610.html