What is the difference between an array and a linked list?
Answer: An array stores elements in contiguous memory and provides fast indexed access. A linked list stores nodes connected by references, making insertion and deletion easier when a node position is known but indexed access slower.
- Memory layout
- Index access
- Insertion/deletion