Linked List Cycle
Try to solve the Linked List Cycle problem.
We'll cover the following
1 of 3
2 of 3
3 of 3
Understand the problem#
Let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Linked List Cycle
What is the output if the following linked list is given as input?
TRUE
FALSE
Figure it out!#
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Try it yourself#
Implement your solution in detect_cycle.py in the following coding playground. You’ll need the provided supporting code to implement your solution.
Note: The first input of the test case includes an array representing the contents of a linked list. The second input represents the index of the node to which the tail pointer is pointing. It will be , in case it is pointing to NULL. The second input is not passed as a parameter in the function because it is just to represent the cycle in the linked list.
Solution: Happy Number
Solution: Linked List Cycle