kaustubhgupta / Hacktoberfest

This is for the information that the repository has been excluded by the Hacktoberfest team from the event. This was done to maintain the quality standards and promote good quality open source contributions.
MIT License
55 stars 277 forks source link

Most important linkedlist question which destroyed the placements of my seniors! #271

Closed Rohanfizz closed 4 years ago

Rohanfizz commented 4 years ago

An important LinkedList dsa question

This question has destroyed my seniors and i want to make it available everywhere possible so that it cant haunt anyone else!

The question is to create a clone of a linkedlist with a random pointer. More information regarding this can be found in this article - https://www.geeksforgeeks.org/a-linked-list-with-next-and-arbit-pointer/

To solve this question we do 3 parses on the linkedlist Parse 1- make clone nodes Parse 2- set the next of original node pointers to their copies Parse 3- not adjust the random pointers

And in the end we disconnect the 2 linkedlists

Language - CPP Please approve the below pull request so that everyone can look at the code. Peace :)

github-actions[bot] commented 4 years ago

Congrats for creating your first issue here! Wait till our mentors assign this issue to you. In the meantime have a look at contribution guidlines to avoid any PR rejection! (Rules are strict here)

Rohanfizz commented 4 years ago

Please accept #272 . Thanks :) Happy Hacktober 2020!