class Solution:
def display(self,head):
current = head
while current:
print(current.data,end=' ')
current = current.next
Hello, I am having some difficulties understanding the above while loop, AFAIK you need to have a condition with a while loop, so:
while (stuff) == True:
But the above code has:
while current:
Is this the same as:
while current == head:
Thanks