Skip to content

Commit

Permalink
Update Program to reverse Linked List( Recursive solution).py
Browse files Browse the repository at this point in the history
ogical issue in the printLinkedList function.

When the function prints the data of each node in the linked list, it does not print a newline character after each node, so the output appears as a single line instead of multiple lines.
  • Loading branch information
nikitapandeyy authored Mar 17, 2023
1 parent 263bd95 commit f608de3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Program to reverse Linked List( Recursive solution).py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ def takeInput():


def printLinkedList(head):

while head is not None:
print(head.data, end=" ")
head = head.next

print()
print()


# main
Expand Down

0 comments on commit f608de3

Please sign in to comment.