Closed Kumar-laxmi closed 4 months ago
@Kumar-laxmi I can do this
@Kumar-laxmi Please assign me this issue for SSOC'23. This shall be my first PR for SSOC
Assigned!
@vedang2003 : C, Java & Python
@vedang2003 What is your status on this issue?
Sorry for the delay I'll push the code today itself.
Please check the PR.
Hello @Kumar-laxmi Please assign me this issue for SSOC'23. my approach will be :-
Here is an example of how the approach works:
Let's say we have the following linked list:
1 -> 2 -> 3 -> 4 -> 5 -> 1
The hash table will start out empty.
When we traverse the linked list, we will first add the node with the address 1 to the hash table.
Then, we will add the node with the address 2 to the hash table.
Then, we will add the node with the address 3 to the hash table.
Then, we will add the node with the address 4 to the hash table.
Finally, we will add the node with the address 5 to the hash table.
At this point, the hash table will contain all the nodes in the linked list.
When we try to add the node with the address 1 to the hash table again, we will find that the address is already in the hash table.
This means that the linked list contains a loop.
The code will return True to indicate that the linked list contains a loop.
Assigned! @NupurHardiya : C, Java & Python
Stale issue message
Is your feature request related to a problem? Please describe. Given a linked list, check if the linked list has a loop (cycle) or not. The below diagram shows a linked list with a loop.
Describe the solution you'd like Follow the steps below to solve the problem:
Additional context