How will you determine if a singly linked list has its own cycle?
By keeping a close track of 2 pointers in the associated linked list and then starting them to the beginning of the same list. With every iteration of the algorithm if the two pointers remain the same other than the beginning then there is a cycle in the algorithm. In case any of the pointer reaches the end of the linked list prior to the pointers remain the same then there is no cycle present in the algorithm. For pointers it is required to do not move one or two nodes at any particular time and it is only required that pointers frequently move at different rates. This process can hardly take 0(n) time.
BY Best Interview Question ON 17 Oct 2019