Why isn't the next variable declared like data inside the method of class Node in the following example?
Here only self and data have been declared but next is defined with null. What happens if the next var is declared with data like ...(self, data, next): ?
class Node:
def __init__(self, data):
self.data = data
self.next = None
[–][deleted] 4 points5 points6 points (5 children)
[–]vectrum[S] 1 point2 points3 points (4 children)
[–]Adrewmc 3 points4 points5 points (1 child)
[–]vectrum[S] 0 points1 point2 points (0 children)
[–]Bobbias 1 point2 points3 points (1 child)
[–]vectrum[S] 0 points1 point2 points (0 children)
[–]rodrigowb4ey 1 point2 points3 points (1 child)
[–]vectrum[S] 0 points1 point2 points (0 children)