geeksforgeeks
search icon
  • Courses
    Sale
  • Tutorials
  • Interview Prep
    Videos
    July 15, 2024 |13.1K Views

    Find the length of loop in linked list

    Linked List, linked-list
     Save  Share   Like
    Description
    Discussion

    Write a function detectAndCountLoop() that checks whether a given Linked List contains loop and if loop is present then returns count of nodes in loop. For example, the loop is present in below-linked list and length of the loop is 4. If the loop is not present, then the function should return 0.

    Find the length of loop in linked list : https://www.geeksforgeeks.org/find-length-of-loop-in-linked-list/

    Recommendations
    Video Thumbnail
    10:09
    Video Thumbnail
    46.1K Views | 10/01/2025...
    Pairwise swap elements of a given linked list
    Video Thumbnail
    08:48
    Video Thumbnail
    5.7K Views | 10/01/2025...
    Identical Linked Lists
    Video Thumbnail
    16:14
    Video Thumbnail
    94.0K Views | 10/01/2025...
    Merge two sorted linked lists
    Video Thumbnail
    06:44
    Video Thumbnail
    28.8K Views | 10/01/2025...
    Remove duplicates from a sorted linked list
    Video Thumbnail
    02:37
    Video Thumbnail
    79.1K Views | 04/01/2025...
    Circular Linked List | Set 1 (Introduction and Applications)
    Video Thumbnail
    20:50
    Video Thumbnail
    13.4K Views | 31/07/2024...
    Reversing a linked list
    Video Thumbnail
    07:00
    Video Thumbnail
    36.4K Views | 31/07/2024...
    Detect and Remove Loop in a Linked List (Explained in Hindi)
    Video Thumbnail
    07:00
    Video Thumbnail
    71.7K Views | 18/07/2024...
    Detection of Loop in a Linked List (Explained In Hindi)
    Video Thumbnail
    11:07
    Video Thumbnail
    3.5K Views | 15/07/2024...
    Sorted insert for circular linked list
    Video Thumbnail
    08:50
    Video Thumbnail
    11.1K Views | 15/07/2024...
    Delete middle of linked list
    GeeksforGeeks
    location
    Corporate & Communications Address:
    A-143, 6th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
    location
    Registered Address:
    K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
    GFG App on Play StoreGFG App on App Store
    • Company
    • About Us
    • Legal
    • Privacy Policy
    • Contact Us
    • Advertise with us
    • GFG Corporate Solution
    • Campus Training Program
    • Explore
    • POTD
    • Job-A-Thon
    • Blogs
    • Nation Skill Up
    • Tutorials
    • Programming Languages
    • DSA
    • Web Technology
    • AI, ML & Data Science
    • DevOps
    • CS Core Subjects
    • Interview Preparation
    • Software and Tools
    • Courses
    • ML and Data Science
    • DSA and Placements
    • Web Development
    • Programming Languages
    • DevOps & Cloud
    • GATE
    • Trending Technologies
    • Videos
    • DSA
    • Python
    • Java
    • C++
    • Web Development
    • Data Science
    • CS Subjects
    • Preparation Corner
    • Interview Corner
    • Aptitude
    • Puzzles
    • GfG 160
    • System Design
    @GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved