Skip to content

Conversation

@nikitapandeyy
Copy link

In the find method, the function is returning the data instead of the node that contains the data. This can be problematic if the data appears multiple times in the linked list, as it will only return the first occurrence. The method should return the node that contains the data, or None if the data is not found.

In the remove method, if the data is not found in the linked list, the method returns False. This is not an ideal way to handle the situation, as it could lead to confusion if the user thinks that the data has been removed when it has not. It would be better to raise an exception, such as a ValueError, to indicate that the data is not in the linked list.

In the find method, the function is returning the data instead of the node that contains the data. This can be problematic if the data appears multiple times in the linked list, as it will only return the first occurrence. The method should return the node that contains the data, or None if the data is not found.

In the remove method, if the data is not found in the linked list, the method returns False. This is not an ideal way to handle the situation, as it could lead to confusion if the user thinks that the data has been removed when it has not. It would be better to raise an exception, such as a ValueError, to indicate that the data is not in the linked list.
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

Successfully merging this pull request may close these issues.

1 participant