def reverseSubList(head, start, finish): if not head: return None if head.getData() != start: temp = head while temp.getNext().getData() != start: temp = temp.getNext() else: temp = Node(None) temp.setNext(head) temp.setNext(reverseLinkedList(temp.getNext(), finish)) if not temp.getData(): return temp.getNext() return head
def test_NodeCreation(): n = Node(20) assert n.getData() == 20 assert n.getNext() == None
def test_NodeSetData(): n = Node(20) n.setData(200) assert n.getData() == 200