Posts

Showing posts from December, 2021

Linked list

Image
  What is linked list? One disadvantage of using array to store data is that array are static structures and therefore cannot be easily extended or reduced to fit the data set. Arrays are also expensive to maintain new insertion and deletion of elements to avoid this we will learn new data structure called Linked List. A linked list is a data structure used for storing collections of data. A linked list has the following properties. ·        Successive elements are connected by pointers ·        The last element points to NULL ·        Can grow or shrink in size during execution of a program ·        Can be made just as long as required ·        Does not waste memory space (but takes some extra memory for pointers). It allocates memory as list grows. Representation of Linked List Let's see how each node of the linked list is represented. Each node in linked list consists of:     A data item.