Example #1
0
def test_merge_node_noextraspace():
    ll = LinkedList()
    ll.push(3)
    ll.push(1)
    ll.push(2)

    ll_one = LinkedList()
    ll_one.push(10)
    ll_one.push(20)

    ll_two = LinkedList()
    ll_two.push(5)

    ll_one.get(1).next = ll.head
    ll_two.get(0).next = ll.head
Example #2
0
def test_merge_node():
    ll = LinkedList()
    ll.push(3)
    ll.push(1)
    ll.push(2)

    ll_one = LinkedList()
    ll_one.push(10)
    ll_one.push(20)

    ll_two = LinkedList()
    ll_two.push(5)

    ll_one.get(1).next = ll.head
    ll_two.get(0).next = ll.head

    assert (mergenode_extraspace(ll_one.head, ll_two.head).data == 3)