---
# System prepended metadata

title: Sprint 3 Module Project 1

---

# Sprint 3 Module Project 1
## insertValueIntoSortedLinkedList
```
def insertValueIntoSortedLinkedList(l, value):
    nodeToInsert = ListNode(value)
    if l == None:
        return nodeToInsert
    if value <= l.value:
        nodeToInsert.next = l
        return nodeToInsert
    curr = l
    while curr != None:
        if curr.next == None:
            curr.next = nodeToInsert
            break
        elif value <= curr.next.value:
            nodeToInsert.next = curr.next
            curr.next = nodeToInsert
            break
        curr = curr.next
    return l
```
## mergeTwoLinkedLists
```
def mergeTwoLinkedLists(l1, l2):
    dummyNode = ListNode('*')
    curr = dummyNode
    a, b = l1, l2
    while a != None and b != None:
        if a.value < b.value:
            temp = a.next
            curr.next = a
            a.next = None
            a = temp
        else:
            temp = b.next
            curr.next = b
            b.next = None
            b = temp
        curr = curr.next
    if a != None:
        curr.next = a
    if b != None:
        curr.next = b
    return dummyNode.next
        
```