Skip to main content

linked-list

A linked list is a fundamental data structure in computer science. It mainly allows efficient insertion and deletion operations compared to arrays. Like arrays, it is also used to implement other data structures like stack, queue and deque. Here’s the comparison of Linked List vs Arrays

Linked List:

Data Structure: Non-contiguous Memory Allocation: Typically allocated one by one to individual elements Insertion/Deletion: Efficient Access: Sequential

Array:

Data Structure: Contiguous Memory Allocation: Typically allocated to the whole array Insertion/Deletion: Inefficient Access: Random