Skip to content

func RemoveByIndex in DoublyLinkedList.go has a problem #11

@renyucheng

Description

@renyucheng

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions