What is the difference between an array and a linked list?

3 stars If you are short on time, start with this one.

In one or two sentences
An array sits in contiguous memory and is reached by index. A linked list connects nodes by pointers, so inserting and deleting in the middle is easy.

Think of your own answer first

Say it out loud, or type it below. What you type never leaves this device.

Follow-up questions

These are likely next questions from an interviewer. Think of your answer first, then press the button.

  1. 1 / 3

    Why is appending to a dynamic array O(1) on average?

Sources checked

This is a textbook level concept, so no outside source is listed.