-
Notifications
You must be signed in to change notification settings - Fork 3
Singly Linked List #4
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
Conversation
while cur_node.next != None: | ||
cur_node = cur_node.next | ||
elems.append(cur_node.data) | ||
print(elems) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are printing elements here then why storing them in the list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to print them as a list, if I directly print the elements, then won't it just print each element on different lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
learn how to print elements in the same line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I know that already, but never thought about using it here, thanks!
Singly Linked List Implementation, Check for any errors or lack of features or efficiency