You are viewing a single comment's thread. Return to all comments →
solution in py3
class Node: def __init__(self,data): self.data=data self.next=None class SinglyLinkedList: def __init__(self): self.head=None def insertNodeAtHead(llist, data): new=Node(data) if llist==None: llist=new else: new.next=llist llist=new return llist
Seems like cookies are disabled on this browser, please enable them to open this website
Insert a node at the head of a linked list
You are viewing a single comment's thread. Return to all comments →
solution in py3