YoVDO

Detect & Remove Loop in Linked List - Approach Discussion + Optimised Implementation

Offered By: CodeHelp - by Babbar via YouTube

Tags

Linked Lists Courses Algorithms Courses Data Structures Courses

Course Description

Overview

Learn how to detect and remove loops in linked lists through this comprehensive 51-minute video tutorial. Explore multiple approaches, including cycle detection and Floyd's cycle detection algorithm, with detailed explanations and code implementations. Understand the underlying principles, proofs, and optimizations for finding the starting node of a loop and removing it from the linked list. Follow along with step-by-step coding demonstrations, gain insights into null checks, and receive homework assignments to reinforce your understanding of this important data structure concept.

Syllabus

- Introduction
- Promotion
- Approach #1 - Detect Cycle
- Code Approach #1 - Detect Cycle
- Approach #2 - Floyd Cycle Detection
- Code Approach #2 - Floyd Cycle Detection
- why this works ?
- Approach #3 - find starting node of Loop
- Proof - why this works ?
- Code Approach #3 - find starting node of Loop
- Approach #4 - Remove Loop from Linked List
- Code Approach #4 - Remove Loop from Linked List
- Merging all Logic - to detect & remove Loop
- Adding NULL Checks
- Homework and Summary


Taught by

CodeHelp - by Babbar

Related Courses

Intro to Computer Science
University of Virginia via Udacity
Design of Computer Programs
Stanford University via Udacity
Analytic Combinatorics, Part I
Princeton University via Coursera
Algorithms, Part I
Princeton University via Coursera
Algorithms, Part II
Princeton University via Coursera