diff --git a/c-cpp/07_linkedlist/LinkedListAlgo.c b/c-cpp/07_linkedlist/LinkedListAlgo.c index 159522fd..b326ee3d 100644 --- a/c-cpp/07_linkedlist/LinkedListAlgo.c +++ b/c-cpp/07_linkedlist/LinkedListAlgo.c @@ -79,6 +79,8 @@ void test_checkCircle() { SinglyLinkedNode* node = malloc(sizeof(SinglyLinkedNode)); node->data = i; current->next = node; + //reset current node + current = node; } current->next = h;