Incomputer science, alinked data structure is adata structure which consists of a set ofdata records (nodes) linked together and organized byreferences (links orpointers). The link between data can also be called aconnector.
In linked data structures, the links are usually treated as specialdata types that can only bedereferenced or compared for equality. Linked data structures are thus contrasted witharrays and other data structures that require performing arithmetic operations on pointers. This distinction holds even when the nodes are actually implemented as elements of a single array, and the references are actually arrayindices: as long as no arithmetic is done on those indices, the data structure is essentially a linked one.
Linking can be done in two ways – using dynamic allocation and using array index linking.
Linked data structures includelinked lists,search trees,expression trees, and many other widely used data structures. They are also key building blocks for many efficient algorithms, such astopological sort[1] andset union-find.[2]
A linked list is a collection of structures ordered not by their physical placement in memory but by logical links that are stored as part of the data in the structure itself. It is not necessary that it should be stored in the adjacent memory locations. Everystructure has a data field and an address field. The Address field contains the address of itssuccessor.
Linked list can be singly, doubly or multiply linked and can either be linear or circular.

The layout of a linked list storing elements of typeT can appear like so:
structLinkedList{Tvalue;// stored valueLinkedListnext;// reference to the next node (or null if last node)}
A search tree is a tree data structure in whose nodes data values can be stored from someordered set, which is such that in an in-order traversal of the tree the nodes are visited in ascending order of the stored values.
Compared to arrays, linked data structures allow more flexibility in organizing the data and in allocating space for it. In arrays, the size of the array must be specified precisely at the beginning, which can be a potential waste of memory, or an arbitrary limitation which would later hinder functionality in some way. A linked data structure is built dynamically and never needs to be bigger than the program requires. It also requires no guessing at creation time, in terms of how much space must be allocated. This is a feature that is key in avoiding wastes of memory.
In an array, the array elements have to be in acontiguous (connected and sequential) portion of memory. But in a linked data structure, the reference to each node gives users the information needed to find the next one. The nodes of a linked data structure can also be moved individually to different locations within physical memory without affecting the logical connections between them, unlike arrays. With due care, a certainprocess orthread can add or delete nodes in one part of a data structure even while other processes or threads are working on other parts.
On the other hand, access to any particular node in a linked data structure requires following a chain of references that are stored in each node. If the structure hasn nodes, and each node contains at mostb links, there will be some nodes that cannot be reached in less than logbn steps, slowing down the process of accessing these nodes - this sometimes represents a considerable slowdown, especially in the case of structures containing large numbers of nodes. For many structures, some nodes may requireworst case up ton−1 steps. In contrast, many array data structures allow access to any element with a constant number of operations, independent of the number of entries.
Broadly the implementation of these linked data structure is throughdynamic data structures. It gives us the chance to use particular space again. Memory can be utilized more efficiently by using these data structures. Memory is allocated as per the need and when memory is not further needed, deallocation is done.
Linked data structures may also incur in substantialmemory allocation overhead (if nodes are allocated individually) and frustratememory paging andprocessor caching algorithms (since they generally have poorlocality of reference). In some cases, linked data structures may also use more memory (for the link fields) than competing array structures. This is because linked data structures are not contiguous. Instances of data can be found all over in memory, unlike arrays.
In arrays, nth element can be accessed immediately, while in a linked data structure we have to follow multiple pointers so element access time varies according to where in the structure the element is.
In sometheoretical models of computation that enforce the constraints of linked structures, such as thepointer machine, many problems require more steps than in the unconstrainedrandom-access machine model.