gdgpce/DSA-Challenges-2024

Cycle Existence in Linked List

Aperta

#8 aperta il 6 ott 2024

 (2 commenti) (0 reazioni) (1 assegnatario)C++ (12 fork)auto 404
good first issuehacktoberfest

Metriche repository

Star
 (2 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor