Visitar URL original
Added reverse method to reverse Singly Linked List by nidhilaad · Pull Request #730 · TheAlgorithms/Java · GitHub
The Wayback Machine - https://web.archive.org/web/20201103185836/https://github.com/TheAlgorithms/Java/pull/730
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

Added reverse method to reverse Singly Linked List #730

Open
wants to merge 1 commit into
base: master
from

Conversation

@nidhilaad
Copy link

@nidhilaad nidhilaad commented Apr 7, 2019

New Method for reversing Linked List if required.

New Method for reversing Linked List if required.
Copy link
Author

@nidhilaad nidhilaad left a comment

New method for Singly Linked List to reverse the List.

Node previous = null;
while(current !=null)
{
next = current.next;

This comment has been minimized.

@havanagrawal

havanagrawal May 2, 2019

I'm curious how this compiled since I don't see a next variable anywhere.

* Reverses the SinglyLinkedList
*/
public void reverse()
{

This comment has been minimized.

@havanagrawal

havanagrawal May 2, 2019

Fix indentation

Suggested change
{
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.