Create a loop for testing ( 5 is pointing to 3 )
head . next . next . next . next . next = head . next . next ; boolean found = detectLoop ( head ) ; if ( found ) System . out . print ( " Loop ▁ Found " ) ; else System . out . print ( " No ▁ Loop ▁ Found " ) ; } }