Finding loops/cycles in a linked list

  Рет қаралды 4,552

CodeVault

CodeVault

Күн бұрын

Пікірлер: 10
@nematkosha6683
@nematkosha6683 3 жыл бұрын
Which site or book would you recommend for linked list structure? i should to study.
@CodeVault
@CodeVault 3 жыл бұрын
I'm really not sure... geeksforgeeks has decent code but it's not the best quality
@nematkosha6683
@nematkosha6683 3 жыл бұрын
@@CodeVault may I have your email this one is my email (nemat.kosha160@gmail.com) send me I email i have some problem to help me
@catalinvrabiuta8
@catalinvrabiuta8 2 жыл бұрын
could you put the code from linked lists on a github repository?
@CodeVault
@CodeVault 2 жыл бұрын
The code from all the videos can be found on our website. Here is the link: code-vault.net/lesson/2t4nd0hjh5:1603732280242
@wassimhaimoudi
@wassimhaimoudi Жыл бұрын
I am having a hard time understanding what would happen if it started looping at node number 3 or 4 basically n>2whereas n is the number of nodes traversed before the first time we encounter a cycle start point. Anyone can help me with that? I tried when n = 3 with 6 nodes total and the first time both pointers intersect at the same location is inside the loop. Basically at node 5. But the problem is the slow pointer didn’t reach the end of the linked list for the first time so we don’t know yet if we are inside a cycle or again since didn’t reach the end from where the cycle loops back which is node 6. Thanks for helping me in advance!
@CodeVault
@CodeVault Жыл бұрын
The fast pointer should always find the slower pointer if a loop exists. It could take more than 1 iteration of the loop for the pointers to coincide
@wassimhaimoudi
@wassimhaimoudi Жыл бұрын
@@CodeVault Thank you for the response! I think I get it now.
@MonkoGames
@MonkoGames 3 жыл бұрын
Im getting a segmentation fault in the while loop
@CodeVault
@CodeVault 3 жыл бұрын
What's the code? And also how do you create the linked list?
Reversing a linked list
9:42
CodeVault
Рет қаралды 7 М.
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
火影忍者一家
Рет қаралды 130 МЛН
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 54 МЛН
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 89 МЛН
L14. Detect a loop or cycle in LinkedList | With proof and Intuition
20:26
Sorted linked list
18:11
CodeVault
Рет қаралды 17 М.
Interview Question: Start of Loop in a Linked List
10:37
Gaurav Sen
Рет қаралды 144 М.
Object-Oriented Programming is Embarrassing: 4 Short Examples
28:03
Short introduction to doubly linked lists
9:59
CodeVault
Рет қаралды 6 М.
Add after an element in a linked list
8:15
CodeVault
Рет қаралды 10 М.
How to properly deal with dynamically allocated memory
13:44
CodeVault
Рет қаралды 9 М.
Faster than Rust and C++: the PERFECT hash table
33:52
strager
Рет қаралды 592 М.
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
火影忍者一家
Рет қаралды 130 МЛН