コード例 #1
0
ファイル: driver.c プロジェクト: pmiriyals/C_Programs
void testdetectloop()
{
	struct node* node = buildlistattailbyref(3);
	printlist(node, "node");
	node->next->next = node;
	printf("\nloop exists = %s\n", detectloop(node) ? "true" : "false");
}
コード例 #2
0
int main()
{
    Node* head = NULL;
 
    push(&head, 20);
    push(&head, 4);
    push(&head, 15);
    push(&head, 10);
    head->next->next->next->next = head;
    detectloop(head);
    return 0;
}