Nov-20-2020, 09:42 PM
I want to create a linked list and insert dummy data to verify it. Please see my code.
class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next a = ListNode(2) a.next = ListNode(4) a.next.next = ListNode(3) print(a)So I want to insert 2,4 and 3. Is the code right?