Skip to content

CircleLinkList has a problem,i think #436

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

Closed
picturetxl opened this issue May 9, 2018 · 1 comment
Closed

CircleLinkList has a problem,i think #436

picturetxl opened this issue May 9, 2018 · 1 comment

Comments

@picturetxl
Copy link

public void display()
{
Node current=head;
for (int i = 1; i <= size; i++) {
System.out.println(current.next.value);
current=current.next;
}
}

public static void main(String[] args)
{
    CircleLinkList<String> cl= new CircleLinkList<>();
    cl.append("hello");
    cl.append("world");
    cl.append("and");
    cl.append("java");

    cl.display();
    // System.out.println("hello java");
}

/**OutPut: Is it wrong? i have no idea
java
null
java
null
*/

@Skhwan
Copy link
Contributor

Skhwan commented May 19, 2018

I agree that there's something wrong with this one. And I also found that the remove method doesn't work properly, it doesn't decrease the list size.

would you mind if I work on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants