pros linked lists have constanttime insertions and deletions in any position in comparison arrays require on time to do the same thing linked lists can continue to expand without having to specify their size ahead of time remember our lectures on array sizing from the array sequence section of the course cons to access an element in a linked list you need to take ok time to go from the head of the list to the kth element in contrast arrays have constant time operations to access elements in an array pros linked lists have constant time insertions and deletions in any position in comparison arrays require o n time to do the same thing linked lists can continue to expand without having to specify their size ahead of time remember our lectures on array sizing from the array sequence section of the course cons to access an element in a linked list you need to take o k time to go from the head of the list to the kth element in contrast arrays have constant time operations to access elements in an array
class DoublyLinkedListNode(object):
    def __init__(self, value):
        self.value = value
        self.next = None
        self.prev = None


class SinglyLinkedListNode(object):
    def __init__(self, value):
        self.value = value
        self.next = None