NodePractice1.py

From WLCS
Revision as of 23:21, 17 October 2013 by Admin (talk | contribs) (Created page with "<syntaxhighlight lang="Python"> class Node: def __init__(self): self.data = 0 self.next = None #Draw the memory diagram of the following code a = Nod...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
class Node:
    def __init__(self):
        self.data = 0
        self.next = None
        
#Draw the memory diagram of the following code
a = Node()
a.num = 20
b = Node()
a.next = b
b.num = 13
b.next = Node()
b.next.num = 14