Skip to content

Latest commit

 

History

History

Readme.md

Linked List

A linked list is a data structure that consists of a sequence of nodes, where each node contains a value and a reference to the next node in the list. The first node is called the head and the last node is called the tail

Linked List Vs Arrays

Linked lists and arrays are both data structures used to store and organize data, but they have distinct differences.

  • Arrays are a collection of elements of the same data type stored in contiguous memory locations with a fixed size, providing constant time access using index but with time-consuming insertion and deletion operations.
  • On the other hand, linked lists are dynamic, with nodes containing values and references to the next node, allowing efficient insertion and deletion operations but with slower access to specific elements.
  • In summary, arrays are better for situations where indexed access and fixed size are important, while linked lists are better for situations where dynamic size and efficient insertion and deletion are important.`

Types of Linked Lists