Arrays and linked lists
Data types existing to store a list of elements in memory, commonly used in algorithms.
Arrays
An array is a collection of elements stored in a contiguous block of memory. Each element is accessed using an index, making retrieval fast and predictable. Arrays are fixed in size, and adding or removing elements requires shifting data, which can be inefficient.
Linked lists
Linked lists are a sequence of elements where each element (node) contains a value and a reference (or link) to the next node. Unlike arrays, linked lists can easily grow or shrink in size, but accessing elements requires traversing the list, making retrieval slower.