MCPcopy Create free account
hub / github.com/SR-Sunny-Raj/Hacktoberfest2021-DSA / main

Function main

10. Linked List/cpp/DetectLoop.cpp:54–72  ·  view source on GitHub ↗

Driver code*/

Source from the content-addressed store, hash-verified

52
53/* Driver code*/
54int main()
55{
56 /* Start with the empty list */
57 Node* head = NULL;
58
59 push(&head, 20);
60 push(&head, 4);
61 push(&head, 15);
62 push(&head, 15);
63 push(&head, 10);
64
65 /* Create a loop for testing */
66 head->next->next->next = head;
67 if (detectLoop(head))
68 cout << "Loop found";
69 else
70 cout << "No Loop";
71 return 0;
72}

Callers

nothing calls this directly

Calls 2

pushFunction · 0.70
detectLoopFunction · 0.70

Tested by

no test coverage detected