Update appNew update is available. Click here to update.
sidenav-btnClose
Topic list
Is it a Circular Linked List?
EASY
15 mins
10 upvotes
Linked List
Topics (Covered in this problem)
Problem solved
Badge
Skill meter
Linked List
-
-
Other topics
Problem solved
Badge
Skill meter
Strings
-
-
Matrices (2D Arrays)
-
-
Sorting
-
-
Binary Search
-
-
Stacks & Queues
-
-
Trees
-
-
Graph
-
-
Dynamic Programming
-
-
Greedy
-
-
Tries
-
-
Arrays
-
-
SQL
-
-
Binary Search Trees
-
-
Heap
-
-
Bit Manipulation
-
-
Solve problems & track your progress
Checkout your overall progress in every topic here
Become
userLevel
Sensei
in DSA topics
Open the topic and solve more problems associated with it to improve your skills
Check out the skill meter for every topic
See how many problems you are left with to solve for cracking any stage. Score more than zero to get your progress counted.

Is it a Circular Linked List?

Contributed by
Sakshi Bansal
Easy
yellow-spark
0/40
Avg time to solve 15 mins
Success Rate 85 %
Share
10 upvotes

Problem Statement

You are given a Singly Linked List of integers. You have to find if the given linked list is circular or not.

image

Detailed explanation ( Input/output format, Notes, Constraints, Images )
Sample Input 1
3
1 2 3 4 -1
1
8 9 8 -1
0
4 -1
1
Sample Output 1
True
False
True
Explanation for Sample Input 1
In the 1st test case, the given list is circular.
In the 2nd test case, the given list is not circular.
In the 3rd test case,  the given list is circular.
Sample Input 2
2
3 2 1 -1
1
1 1 1 -1
0
Sample Output 2
True
False
Reset Code
Full screen
Auto
copy-code
Console