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

func RemoveByIndex in DoublyLinkedList.go has a problem #11

Open
renyucheng opened this issue Jun 26, 2018 · 0 comments
Open

func RemoveByIndex in DoublyLinkedList.go has a problem #11

renyucheng opened this issue Jun 26, 2018 · 0 comments

Comments

@renyucheng
Copy link

the block below has a problem that the previous head can still be referred to

if i == 0 {
	list.head.prev = nil
	list.head = list.head.next
	return true
}

it should be like this

if i == 0 {
	list.head = list.head.next
        list.head.prev = nil
	return true
}
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

1 participant