
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
Explain the concept of Linked list in C language
Before understanding the linked list, let us learn about the disadvantages of arrays and the advantages of pointers in C programming language.
Disadvantages of Arrays
It includes static memory allocation
Wastage of memory can be experienced in arrays.
Insufficiency of memory is one of the important disadvantage of arrays.
Advantages of pointers
- It includes dynamic memory allocation.
- Effective usage of memory can be experienced in pointers.
Linked Lists
Linked lists use dynamic memory allocation i.e. they grow and shrink accordingly. They are defined as a collection of nodes. Here, nodes have two parts, which are data and link. The representation of data, link and linked lists is given below −
Types of Linked Lists
Linked lists have four types, which are as follows −
- Single / Singly linked lists
- Double / Doubly linked lists
- Circular single linked list
- Circular double linked list
Single linked list
Refer the representation given below −
Node consists of two parts, which are as follows −
- Data
- Link
The link field always point to the next node in the list.
The link field of the last node is null.
Double linked list
Refer the representation given below −
Node consists of three parts namely
- Data part
- Left link
- Right link
The left link always points to the left node in the list and the right link always points to the right node in the list.
The left link of the first node and the right link of the last node must be Null.
Circular single linked list
Refer the representation given below −
Node consists of two parts, namely,
- Data part
- Link part
The link field always points to the next node in the list.
The link part of the last node always points to the first node.
Circular double linked list
Refer the representation given below −
Node consists of three parts, namely,
- Data part
- Left link
- Right link
Left link always points to the left node in the list and the right link points to the right node in the list.
The left link of the first node points to last node & right link of the last node points to the first node.
- Related Articles
- Explain insertion of elements in linked list using C language
- Explain the stack by using linked list in C language
- Explain queue by using linked list in C language
- Explain the concept of pointers in C language
- Explain the concept of Sorting in C language
- Explain the concept of stack in C language
- Explain the concept of pointer accessing in C language
- Explain the concept of Arithmetic operators in C language
- Explain the concept of union of structures in C language
- Explain the concept of Uninitialized array accessing in C language
- Explain the concept of logical and assignment operator in C language
- Explain the concept of pointer to pointer and void pointer in C language?
- Print the alternate nodes of linked list (Iterative Method) in C language
- Explain bit field in C language by using structure concept
- Print nodes of linked list at given indexes in C language
