Types of Linked Lists | Programming and Data Structures - Computer Science Engineering (CSE) PDF Download

In this tutorial, you will learn different types of linked list. Also, you will find implementation of linked list in C.
Before you learn about the type of the linked list, make sure you know about the LinkedList Data Structure.

There are three common types of Linked List:

  • Singly Linked List
  • Doubly Linked List
  • Circular Linked List

1. Singly Linked List

It is the most common. Each node has data and a pointer to the next node.
Singly linked listSingly linked list

Node is represented as:
Types of Linked Lists | Programming and Data Structures - Computer Science Engineering (CSE)
A three-member singly linked list can be created as:
Types of Linked Lists | Programming and Data Structures - Computer Science Engineering (CSE)

2. Doubly Linked List

We add a pointer to the previous node in a doubly-linked list. Thus, we can go in either direction: forward or backward.
Doubly linked listDoubly linked listA node is represented as:
Types of Linked Lists | Programming and Data Structures - Computer Science Engineering (CSE)
A three-member doubly linked list can be created as:
Types of Linked Lists | Programming and Data Structures - Computer Science Engineering (CSE)

3. Circular Linked List

A circular linked list is a variation of a linked list in which the last element is linked to the first element. This forms a circular loop.
Circular linked listCircular linked list

A circular linked list can be either singly linked or doubly linked:

  • For singly linked list, next pointer of last item points to the first item
  • In the doubly linked list, Types of Linked Lists | Programming and Data Structures - Computer Science Engineering (CSE) pointer of the first item points to the last item as well.

A three-member circular singly linked list can be created as:
Types of Linked Lists | Programming and Data Structures - Computer Science Engineering (CSE)

The document Types of Linked Lists | Programming and Data Structures - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Programming and Data Structures.
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
119 docs|30 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Types of Linked Lists - Programming and Data Structures - Computer Science Engineering (CSE)

1. What are the different types of linked lists?
Ans. The different types of linked lists are: 1. Singly Linked List: Each node in the list contains a data element and a reference to the next node in the list. 2. Doubly Linked List: Each node in the list contains a data element, a reference to the next node, and a reference to the previous node in the list. 3. Circular Linked List: Similar to a singly or doubly linked list, but the last node's next pointer points back to the first node (in a singly circular linked list) or the last node's previous pointer points back to the first node (in a doubly circular linked list). 4. Sorted Linked List: A linked list where the nodes are arranged in a particular order, such as ascending or descending order based on the data elements. 5. Skip List: A modified linked list that allows for efficient searching by creating multiple layers of linked lists, with each layer skipping a fixed number of nodes.
2. What is the difference between singly linked list and doubly linked list?
Ans. The main differences between a singly linked list and a doubly linked list are: 1. Singly Linked List: Each node in a singly linked list contains a reference to the next node in the list. Traversing the list can only be done in one direction, from the head (or start) of the list to the tail (or end) of the list. It requires less memory as it only needs to store one reference per node. 2. Doubly Linked List: Each node in a doubly linked list contains a reference to both the next node and the previous node in the list. Traversing the list can be done in both directions, from the head to the tail and from the tail to the head. It requires more memory as it needs to store two references per node.
3. How does a circular linked list differ from a regular linked list?
Ans. A circular linked list differs from a regular linked list in the way it terminates. In a regular linked list, the last node's next pointer is set to null to indicate the end of the list. However, in a circular linked list, the last node's next pointer (in a singly circular linked list) or the last node's previous pointer (in a doubly circular linked list) points back to the first node, creating a circular structure. This allows for easy traversal from the last node to the first node, making certain operations more efficient.
4. What is a sorted linked list?
Ans. A sorted linked list is a type of linked list where the nodes are arranged in a specific order based on the data elements they contain. The order can be ascending or descending, and it allows for efficient searching and insertion of elements in the list. When inserting a new element into a sorted linked list, it is placed in the appropriate position to maintain the sorted order. This ensures that the elements in the list are always sorted without the need for additional sorting operations.
5. What is a skip list and how does it work?
Ans. A skip list is a modified version of a linked list that allows for efficient searching by creating multiple layers of linked lists. Each layer is a subset of the nodes in the previous layer, with each layer skipping a fixed number of nodes. The top layer contains all the nodes, while the bottom layer contains only the first and last nodes. This structure allows for faster searching by skipping unnecessary nodes in the higher layers and focusing on the relevant nodes in the lower layers. The skip list takes advantage of the probability distribution to determine the skip length, resulting in efficient search operations.
119 docs|30 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

ppt

,

Extra Questions

,

Semester Notes

,

Types of Linked Lists | Programming and Data Structures - Computer Science Engineering (CSE)

,

practice quizzes

,

Summary

,

shortcuts and tricks

,

video lectures

,

past year papers

,

MCQs

,

Types of Linked Lists | Programming and Data Structures - Computer Science Engineering (CSE)

,

Viva Questions

,

mock tests for examination

,

Exam

,

pdf

,

Objective type Questions

,

Important questions

,

study material

,

Previous Year Questions with Solutions

,

Free

,

Sample Paper

,

Types of Linked Lists | Programming and Data Structures - Computer Science Engineering (CSE)

;