An array is a collection of items stored at contiguous memory locations. The idea is to store multiple items of the same type together.
#include <stdio.h>
int main() {
int arr[5] = {10, 20, 30, 40, 50};
// Accessing elements
printf("Element at index 2: %d", arr[2]); // Output: 30
return 0;
}A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements in a linked list are linked using pointers.
struct Node {
int data;
struct Node* next;
};Last updated: 11/30/2025