Linked List
Linked List
// Data field
int data;
// Driver code
int main() {
return 0;
}
Output
Linked List: 2 3 4 5 6
Linked List vs. Array:
Array Linked List
Arrays are stored in contiguous Linked Lists are not stored in contiguous
location. location.
Only store elements no extra It stores both data and address of next
reference / pointer. node.