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

Update LinkedList0.py #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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