Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1344 addition of clone of linked list with random connection #1377

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

SKG24
Copy link
Contributor

@SKG24 SKG24 commented Oct 28, 2024

Given a linked list where each node has a next pointer to the next node in the list and a random pointer that can point to any node in the list (or be NULL), create a deep copy (clone) of the list. The cloned list should have nodes with the same values and maintain the same next and random pointers structure as the original list.

Screenshot 2024-10-28 at 6 52 06 PM

Screen.Recording.2024-10-28.at.7.05.26.PM.mov

Sanat Kumar Gupta
gssoc-ext, hacktoberfest

Given a linked list where each node has a next pointer to the next node in the list and a random pointer that can point to any node in the list (or be NULL), create a deep copy (clone) of the list. The cloned list should have nodes with the same values and maintain the same next and random pointers structure as the original list.
Copy link
Member

@pankaj-bind pankaj-bind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not accepting C++ programs

I have changed the code from cpp to C. Also, I have made edits in readme according to the code.
@SKG24
Copy link
Contributor Author

SKG24 commented Oct 29, 2024

Hey! Could you please verify that this updated code is fine? I have tested this code and it is working.

Screen.Recording.2024-10-29.at.12.29.38.PM.mov

@pankaj-bind pankaj-bind merged commit aec82f0 into AlgoGenesis:main Oct 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants