Skip to content

File master/DataStructures/Lists/SinglyLinkedList.java line 146 may cause NullPointerException #771

@Seandba

Description

@Seandba

In the main method line 146,if you change myList.deleteNth(1) to myList.deleteNth(3),3 is the count of list[7 -> 5 -> 11],you will ses (Exception in thread "main" java.lang.NullPointerException),because the postion in the deleteNth() method should from zero to (the count of list minus 1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions