Skip to content

Conversation

nirmalnishant645
Copy link
Owner

Singly Linked List Implementation, Check for any errors or lack of features or efficiency

while cur_node.next != None:
cur_node = cur_node.next
elems.append(cur_node.data)
print(elems)
Copy link
Collaborator

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?

Copy link
Owner Author

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?

Copy link
Collaborator

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

Copy link
Owner Author

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!

@anantkaushik anantkaushik merged commit b8d5d5a into master Jan 29, 2020
@nirmalnishant645 nirmalnishant645 deleted the problem branch February 12, 2020 04:46
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.

2 participants