gdgpce/DSA-Challenges-2024

Cycle Existence in Linked List

Open

#8 opened on Oct 6, 2024

 (2 comments) (0 reactions) (1 assignee)C++ (12 forks)auto 404
good first issuehacktoberfest

Repository metrics

Stars
 (2 stars)
PR merge metrics
 (PR metrics pending)

Description

Problem: Given a head/root node of a linked list, determine if it contains a cycle. Return true if cycle exists otherwise false.

class Node{
public:
    int val;
    Node* next;

    Node(int s){
        val = s;
        next = NULL;
    }
};

  1. Follow and Read the Contributing Guidelines.

  2. Only the assigned person is allowed to raise the PR on this Issue.

  3. To get this issue assigned to you comment on this issue, along with your name, branch and year.

Note: Make sure to put the question under the relevant folder structure, and then make another folder having the question name and inside that folder you can write your solution in any preferred language.

Contributor guide