This document discusses different types of linked lists, their advantages and disadvantages. It begins by explaining that a linked list consists of nodes where each node contains a data field and a pointer to the next node. It notes the advantages of linked lists over arrays are efficient memory usage, easy insertion and deletion, and arbitrary memory locations. However, linked lists require more space per node and have slower random access. The document then describes different types of linked lists - singly linked, doubly linked, circularly linked, and doubly circularly linked lists. It provides examples of each type of linked list.
3. Linked list is one of the fundamental data structures, and can be used to implement
other data structures.
In a linked list there are different numbers of nodes.
Each node consists of two fields.
ĂThe first field holds the value or data
ĂThe second field holds the reference to the next node or null if the linked list is
empty.
Node
Linked List ???
Data / Info link / next
4. Linked lists have the following advantages over arrays:
1.Efficient memory utilization
2.Operations such as insertion and deletion are easy and efficient.
3.Size can be changed.
4.Extensive manipulations
5.Arbitrary memory locations
Advantages of Linked List
5. 1)Each node requires an extra pointer in addition to information, requiring more
space.
2)Insertion or deletion of a node takes a bit longer because it involves more pointer
operations.
3)Linked lists do not allow random access.
4)Traversing and changing of pointers consumes a lot of time.
5)Programming is typically trickier with pointers.
6)It is quite difficult to sort elements in a linked list.
Disadvantages of Linked List
6. Types of Linked List
Singly-linked list
The simplest kind of linked list is a singly-linked list (or slist for short), which has
one link per node. This link points to the next node in the list, or to a null value or
empty list if it is the last node.
7. Types of Linked List
Doubly-linked list
A more sophisticated kind of linked list is a doubly-linked list. Each node has two
links, one to the previous node and one to the next node.
8. Types of Linked List
Circularly-linked list
In a circularly-linked list, the first and last nodes are linked together. This can be
done for both singly and doubly linked lists. To traverse a circular linked list, you
begin at any node and follow the list in either direction until you return to the
original node.
Viewed another way, circularly-linked lists can be seen as having no beginning or
end.
9. Types of Linked List
Singly âcircularly linked list
A singly linked circular list is a linked list where the last node in the list points to
the first node in the list. A circular list does not contain NULL pointers.
15 70 45
Doubly-circularly-linked list
In a doubly-circularly-linked list, each node has two links, similar to a doubly-linked
list, except that the previous link of the first node points to the last node and the next
link of the last node points to the first node.