MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / push

Function push

GeeksForGeeks/Detect Loop in Linked List/solution.cpp:11–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9};
10
11void push(Node** head_ref, int new_data)
12{
13 /* allocate node */
14 Node* new_node = new Node();
15
16 /* put in the data */
17 new_node->data = new_data;
18
19 /* link the old list off the new node */
20 new_node->next = (*head_ref);
21
22 /* move the head to point to the new node */
23 (*head_ref) = new_node;
24}
25
26int detectLoop(Node* list)
27{

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected