1. Adding an element to the beginning of the list

    1. Answers:

      Array: O(n)

      Singly Linked List: O(1)

      Doubly Linked List: O(1)

  2. Adding an element to the end of the list (what are things to consider for arrays?)

    1. Answers:

      Array: O(1) if the array is not full, O(n) if full

      Singly Linked List: O(n)

      Doubly Linked List: O(1)

  3. Adding an element to the middle of the list

    1. Answers:

      Array: O(n)

      Singly Linked List: O(n)

      Doubly Linked List: O(n)

  4. Deleting an element from the end of the list

    1. Answers:

      Array: O(1)

      Singly Linked List: O(n)

      Doubly Linked List: O(1)

  5. Deleting an element from the middle of the list

    1. Answers:

      Array: O(n)

      Singly Linked List: O(n)

      Doubly Linked List:

  6. Deleting an element from the beginning of the list

    1. Answers:

      Array: O(n)

      Singly Linked List: O(n)

      Doubly Linked List:

  7. Finding an element in the list

    1. Answers:

      Array: O(n)

      Singly Linked List: O(n)

      Doubly Linked List:

  8. Accessing the 5th element of the list (assuming there are at least 5 elements)

    1. Answers:

      Array: O(1)

      Singly Linked List: O(n)

      Doubly Linked List: O(n)

What are some of the disadvantages of arrays?

What are some ideas you have for improving upon these disadvantages?

What are some of the disadvantages of linked lists?

What are some ideas you have for improving upon these disadvantages?