Mridul-1-Sharma / data_structures_algos

Contribute to this repository with valid pull request to Hacktoberfest 2022 and earn awesome swags & T-shirts. This is a beginner friendly Project.
MIT License
7 stars 27 forks source link

Reverse Linked List Problem in C++. #38

Closed akhilesh5056 closed 2 years ago

akhilesh5056 commented 2 years ago

Given a pointer to the head node of a linked list, the task is to reverse the linked list. We need to reverse the list by changing the links between nodes.

Approach: The idea is to use three pointers curr, prev, and next to keep track of nodes to update reverse links.

akhilesh5056 commented 2 years ago

@Mridul-1-Sharma I have done the changes .Kindly review my PR under Hacktoberfest 2022.

Mridul-1-Sharma commented 2 years ago

@Mridul-1-Sharma I have done the changes .Kindly review my PR under Hacktoberfest 2022.

Provide description in the description box not in comments